aboutsummaryrefslogtreecommitdiff
path: root/tests/11-ordered-choice.sh
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-08-28 14:26:32 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-08-28 14:26:32 -0700
commit16bf40bd649ba065a7a0a6008c8434335ffae55a (patch)
tree526af942dedd9e6198035d2628a089c61541aee0 /tests/11-ordered-choice.sh
parent9db5e91781b71939fd3cd9dd0e8e922e7d52e449 (diff)
Added tests/tutorial
Diffstat (limited to 'tests/11-ordered-choice.sh')
-rw-r--r--tests/11-ordered-choice.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/11-ordered-choice.sh b/tests/11-ordered-choice.sh
new file mode 100644
index 0000000..277741d
--- /dev/null
+++ b/tests/11-ordered-choice.sh
@@ -0,0 +1,5 @@
+# The ordered choice operator (/) picks the first choice that matches
+# Example: bp -p '"cabaret"/"cab"' matches either "cabaret" or "cab"
+# Note: if a match occurs, the options to the right will *never* be attempted,
+# so bp -p '"cab"/"cabaret"' will always match "cab" instead of "cabaret"
+bp -p '"foo" / "bar"'