summaryrefslogtreecommitdiff
path: root/subplot.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-01-24 19:48:19 +0200
committerLars Wirzenius <liw@liw.fi>2022-01-26 19:08:00 +0200
commitf285f652c39db1b8e51eee9a499fadec7b0bec91 (patch)
tree554a73ac2f112c8a34f58b3f8bae8dcfb1000345 /subplot.md
parent43f72bf660ade91c08e09d62923c2d4635fb8e16 (diff)
downloadsubplot-f285f652c39db1b8e51eee9a499fadec7b0bec91.tar.gz
feat: automatically use "and" on output
This changes typesetting of scenarios so that when two adjacent scenario steps have the same keyword, "and" is used on the second one. This means that when input has when I do foo when I do bar the output will have when I do foo and I do bar I didn't bother to make this configurable. I don't feel that level of configuration is good. The "keyword aliases" scenario is repurposed to verify this. Sponsored-by: author
Diffstat (limited to 'subplot.md')
-rw-r--r--subplot.md26
1 files changed, 15 insertions, 11 deletions
diff --git a/subplot.md b/subplot.md
index d2ec877..017cb5a 100644
--- a/subplot.md
+++ b/subplot.md
@@ -1144,20 +1144,24 @@ but foobar was done
```
~~~
-### Keyword aliases
+### Keyword aliases in output
+
+We support **and** and **but** in input lines, and we always render
+scenarios in output so they are used when they are allowed. This
+scenario verifies that this happens.
~~~scenario
given file aliases.md
-and file b.yaml
-and file f.py
-and an installed subplot
+given file b.yaml
+given file f.py
+given an installed subplot
when I run subplot docgen aliases.md -o aliases.html
+then command is successful
then file aliases.html matches regex /given<[^>]*> precondition foo/
-and file aliases.html matches regex /when<[^>]*> I do bar/
-and file aliases.html matches regex /and<[^>]*> I do foobar/
-and file aliases.html matches regex /then<[^>]*> bar was done/
-and file aliases.html matches regex /but<[^>]*> foobar was done/
-and command is successful
+then file aliases.html matches regex /when<[^>]*> I do bar/
+then file aliases.html matches regex /and<[^>]*> I do foobar/
+then file aliases.html matches regex /then<[^>]*> bar was done/
+then file aliases.html matches regex /and<[^>]*> foobar was done/
~~~
~~~{#aliases.md .file .markdown .numberLines}
@@ -1172,9 +1176,9 @@ functions: [f.py]
```scenario
given precondition foo
when I do bar
-and I do foobar
+when I do foobar
then bar was done
-but foobar was done
+then foobar was done
```
~~~