summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-10-27 20:22:39 +0300
committerLars Wirzenius <liw@liw.fi>2021-10-28 11:10:42 +0300
commit5321180f75f69ce2699b6299488576feb6a60499 (patch)
tree0e819ad111d4c1692546b4bbcee7780fa326685f /share
parenta652f1995a81ccb3846f014b7a6de8a2358d1695 (diff)
downloadsubplot-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 'share')
-rw-r--r--share/common/lib/runcmd.yaml48
1 files changed, 16 insertions, 32 deletions
diff --git a/share/common/lib/runcmd.yaml b/share/common/lib/runcmd.yaml
index bde2f69..5847613 100644
--- a/share/common/lib/runcmd.yaml
+++ b/share/common/lib/runcmd.yaml
@@ -16,32 +16,28 @@
rust:
function: subplotlib::steplibrary::runcmd::helper_srcdir_path
-- when: I run (?P<argv0>\S+)(?P<args>.*)
- regex: true
+- when: I run {argv0}{args:text}
impl:
python:
function: runcmd_step
rust:
function: subplotlib::steplibrary::runcmd::run
-- when: I run, in (?P<dirname>\S+), (?P<argv0>\S+)(?P<args>.*)
- regex: true
+- when: I run, in {dirname}, {argv0}{args:text}
impl:
python:
function: runcmd_step_in
rust:
function: subplotlib::steplibrary::runcmd::run_in
-- when: I try to run (?P<argv0>\S+)(?P<args>.*)
- regex: true
+- when: I try to run {argv0}{args:text}
impl:
python:
function: runcmd_try_to_run
rust:
function: subplotlib::steplibrary::runcmd::try_to_run
-- when: I try to run, in (?P<dirname>\S+), (?P<argv0>\S+)(?P<args>.*)
- regex: true
+- when: I try to run, in {dirname}, {argv0}{args:text}
impl:
python:
function: runcmd_try_to_run_in
@@ -84,32 +80,28 @@
# Steps to examine stdout/stderr for exact content.
-- then: stdout is exactly "(?P<text>.*)"
- regex: true
+- then: stdout is exactly "{text:text}"
impl:
python:
function: runcmd_stdout_is
rust:
function: subplotlib::steplibrary::runcmd::stdout_is
-- then: 'stdout isn''t exactly "(?P<text>.*)"'
- regex: true
+- then: 'stdout isn''t exactly "{text:text}"'
impl:
python:
function: runcmd_stdout_isnt
rust:
function: subplotlib::steplibrary::runcmd::stdout_isnt
-- then: stderr is exactly "(?P<text>.*)"
- regex: true
+- then: stderr is exactly "{text:text}"
impl:
python:
function: runcmd_stderr_is
rust:
function: subplotlib::steplibrary::runcmd::stderr_is
-- then: 'stderr isn''t exactly "(?P<text>.*)"'
- regex: true
+- then: 'stderr isn''t exactly "{text:text}"'
impl:
python:
function: runcmd_stderr_isnt
@@ -118,32 +110,28 @@
# Steps to examine stdout/stderr for sub-strings.
-- then: stdout contains "(?P<text>.*)"
- regex: true
+- then: stdout contains "{text:text}"
impl:
python:
function: runcmd_stdout_contains
rust:
function: subplotlib::steplibrary::runcmd::stdout_contains
-- then: 'stdout doesn''t contain "(?P<text>.*)"'
- regex: true
+- then: 'stdout doesn''t contain "{text:text}"'
impl:
python:
function: runcmd_stdout_doesnt_contain
rust:
function: subplotlib::steplibrary::runcmd::stdout_doesnt_contain
-- then: stderr contains "(?P<text>.*)"
- regex: true
+- then: stderr contains "{text:text}"
impl:
python:
function: runcmd_stderr_contains
rust:
function: subplotlib::steplibrary::runcmd::stderr_contains
-- then: 'stderr doesn''t contain "(?P<text>.*)"'
- regex: true
+- then: 'stderr doesn''t contain "{text:text}"'
impl:
python:
function: runcmd_stderr_doesnt_contain
@@ -152,32 +140,28 @@
# Steps to match stdout/stderr against regular expressions.
-- then: stdout matches regex (?P<regex>.*)
- regex: true
+- then: stdout matches regex {regex:text}
impl:
python:
function: runcmd_stdout_matches_regex
rust:
function: subplotlib::steplibrary::runcmd::stdout_matches_regex
-- then: stdout doesn't match regex (?P<regex>.*)
- regex: true
+- then: stdout doesn't match regex {regex:text}
impl:
python:
function: runcmd_stdout_doesnt_match_regex
rust:
function: subplotlib::steplibrary::runcmd::stdout_doesnt_match_regex
-- then: stderr matches regex (?P<regex>.*)
- regex: true
+- then: stderr matches regex {regex:text}
impl:
python:
function: runcmd_stderr_matches_regex
rust:
function: subplotlib::steplibrary::runcmd::stderr_matches_regex
-- then: stderr doesn't match regex (?P<regex>.*)
- regex: true
+- then: stderr doesn't match regex {regex:text}
impl:
python:
function: runcmd_stderr_doesnt_match_regex