diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-10-27 20:22:39 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-10-28 11:10:42 +0300 |
commit | 5321180f75f69ce2699b6299488576feb6a60499 (patch) | |
tree | 0e819ad111d4c1692546b4bbcee7780fa326685f /examples | |
parent | a652f1995a81ccb3846f014b7a6de8a2358d1695 (diff) | |
download | subplot-5321180f75f69ce2699b6299488576feb6a60499.tar.gz |
refactor: use simple patterns where possible
Many of our bindings files were originally written before Subplot
supported simple patterns, and so they use regex patterns even when a
simple pattern would do. Simplify bindings to use simple patterns when
possible, to make life easier for future maintainers.
Sponsored-by: author
Diffstat (limited to 'examples')
-rw-r--r-- | examples/echo/echo.yaml | 9 | ||||
-rw-r--r-- | examples/muck/muck.yaml | 3 |
2 files changed, 4 insertions, 8 deletions
diff --git a/examples/echo/echo.yaml b/examples/echo/echo.yaml index bcbdf87..d68a32f 100644 --- a/examples/echo/echo.yaml +++ b/examples/echo/echo.yaml @@ -3,28 +3,25 @@ bash: function: run_echo_without_args -- when: user runs echo with arguments (?P<args>.+) +- when: user runs echo with arguments {args:text} impl: bash: function: run_echo_with_args - regex: true -- then: exit code is (?P<exit_code>\d+) +- then: exit code is {exit_code:uint} impl: bash: function: exit_code_is - regex: true - then: standard output contains a newline impl: bash: function: stdout_is_a_newline -- then: standard output contains "(?P<text>.*)" +- then: standard output contains "{text:text}" impl: bash: function: stdout_is_text - regex: true - then: standard error is empty impl: diff --git a/examples/muck/muck.yaml b/examples/muck/muck.yaml index 10f67ee..b22e088 100644 --- a/examples/muck/muck.yaml +++ b/examples/muck/muck.yaml @@ -43,11 +43,10 @@ function: fixme regex: true -- then: "response code is (?P<code>\\d+)" +- then: "response code is {code:uint}" impl: python: function: fixme - regex: true - then: "header {header} is {name}" impl: |