From 81f7dcca6528252c1f0a57d3b5581c628efa4bf1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 21 Oct 2014 06:13:14 -0700 Subject: * 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. --- tests/011/txr-case.expected | 4 ++++ tests/011/txr-case.txr | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/011/txr-case.expected create mode 100644 tests/011/txr-case.txr (limited to 'tests/011') 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`)))) -- cgit v1.2.3