summaryrefslogtreecommitdiffstats
path: root/tests/011
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-10-21 06:13:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-10-21 06:13:14 -0700
commit81f7dcca6528252c1f0a57d3b5581c628efa4bf1 (patch)
tree71d3457395914ae14b7423cc7b3c9aff21525437 /tests/011
parentc8b05c1e80d9b17a4fb002ee2cd8683632e6184d (diff)
downloadtxr-81f7dcca6528252c1f0a57d3b5581c628efa4bf1.tar.gz
txr-81f7dcca6528252c1f0a57d3b5581c628efa4bf1.tar.bz2
txr-81f7dcca6528252c1f0a57d3b5581c628efa4bf1.zip
* share/txr/stdlib/txr-case.txr: New file.
* txr.1: Document txr-if, txr-when and txr-case. * genvim.txr: Added new macro names. * tests/011/txr-case.expected: New file. * tests/011/txr-case.txr: New file. * txr.vim: Regenerated.
Diffstat (limited to 'tests/011')
-rw-r--r--tests/011/txr-case.expected4
-rw-r--r--tests/011/txr-case.txr9
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/011/txr-case.expected b/tests/011/txr-case.expected
new file mode 100644
index 00000000..4af473e5
--- /dev/null
+++ b/tests/011/txr-case.expected
@@ -0,0 +1,4 @@
+no match for 09-10-20
+match: year 2009, month 10, day 20
+no match for July-15-2014
+no match for foo
diff --git a/tests/011/txr-case.txr b/tests/011/txr-case.txr
new file mode 100644
index 00000000..f427be9e
--- /dev/null
+++ b/tests/011/txr-case.txr
@@ -0,0 +1,9 @@
+@(include `@stdlib/txr-case`)
+@(define date (year month day))
+@{year /\d\d\d\d/}-@{month /\d\d/}-@{day /\d\d/}
+@(end)
+@(do
+ (each ((date '("09-10-20" "2009-10-20" "July-15-2014" "foo")))
+ (txr-if date (y m d) date
+ (put-line `match: year @y, month @m, day @d`)
+ (put-line `no match for @date`))))