diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-05-02 09:59:06 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-05-02 14:33:58 +0300 |
commit | b27aca0817b24596f748b93fe2b52899247f23fb (patch) | |
tree | 23088a00f7284ebdb3dbd92c66c2335c7f8e39a0 /subplot.yaml | |
parent | d9e1fa5cf7db06f3ef0a255d533f45900627b307 (diff) | |
download | subplot-b27aca0817b24596f748b93fe2b52899247f23fb.tar.gz |
Fix: check that stdout matches expected pattern
The stdout_matches function in subplot.py was lacking an assert. This
meant all steps checking that stdout contained a desired string
passed, even when they shouldn't have.
I did the original changes sloppily: I should've verified the test
fails with a wrong pattern before finishing the stdout_matches
function.
Also, fix scenarios that were passing because of this, but shouldn't
have been.
Further, fixing this revealed another problem: the way subplot.md was
checking that the simple and regex patterns were working was broken:
they were using a step that looked for specific output to make sure a
nested subplot was calling its function, but doing that in a way that
assumed specific output. This wasn't just broken, but also very
confusing to debug. This commit changes things so the generic stdout
matching step is used instead and is clearer to me.
Diffstat (limited to 'subplot.yaml')
-rw-r--r-- | subplot.yaml | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/subplot.yaml b/subplot.yaml index 55e4c6c..e454f47 100644 --- a/subplot.yaml +++ b/subplot.yaml @@ -49,9 +49,6 @@ - then: "{filename} has the same metadata as before" function: has_same_metadata_as_remembered -- then: function got {arg} as an argument - function: function_got_arg - - then: output matches /(?P<pattern>.+)/ function: stdout_matches regex: true |