From 2e7542a6b590e4662cff1ab1eab62945b7bbccad Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 1 Oct 2011 19:46:34 -0700 Subject: New test case, covering exception handling across nested function invocations. * Makefile (TEST): Test targets marked as .PHONY, because they are. * tests/007/except-1.expected: New file. * tests/007/except-1.out: New file. * tests/007/except-1.txr: New file. --- ChangeLog | 11 +++++++++++ Makefile | 2 +- tests/007/except-1.expected | 2 ++ tests/007/except-1.out | 2 ++ tests/007/except-1.txr | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 tests/007/except-1.expected create mode 100644 tests/007/except-1.out create mode 100644 tests/007/except-1.txr diff --git a/ChangeLog b/ChangeLog index 74da2f6e..a57a1615 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-10-01 Kaz Kylheku + + New test case, covering exception handling across nested + function invocations. + + * Makefile (TEST): Test targets marked as .PHONY, because they are. + + * tests/007/except-1.expected: New file. + * tests/007/except-1.out: New file. + * tests/007/except-1.txr: New file. + 2011-10-01 Kaz Kylheku * parser.y (all_clause, some_clause, none_clause, maybe_clause, diff --git a/Makefile b/Makefile index b555b657..e32cc0b4 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ depend: TESTS := $(patsubst $(top_srcdir)/%.txr,./%.ok,\ $(shell find $(top_srcdir)/tests -name '*.txr' | sort)) -.PHONY: tests +.PHONY: tests $(TEST) tests: $(TESTS) @echo "** tests passed!" diff --git a/tests/007/except-1.expected b/tests/007/except-1.expected new file mode 100644 index 00000000..93127102 --- /dev/null +++ b/tests/007/except-1.expected @@ -0,0 +1,2 @@ +caught u0: text0 +caught u1: text1 diff --git a/tests/007/except-1.out b/tests/007/except-1.out new file mode 100644 index 00000000..93127102 --- /dev/null +++ b/tests/007/except-1.out @@ -0,0 +1,2 @@ +caught u0: text0 +caught u1: text1 diff --git a/tests/007/except-1.txr b/tests/007/except-1.txr new file mode 100644 index 00000000..7f205a7f --- /dev/null +++ b/tests/007/except-1.txr @@ -0,0 +1,32 @@ +@(defex u0) +@(defex u1) +@(define baz (x)) +@ (cases) +@ (bind x "0") +@ (throw u0 "text0") +@ (or) +@ (bind x "1") +@ (throw u1 "text1") +@ (end) +@(end) +@(define bar (x)) +@ (baz x) +@(end) +@(define foo ()) +@ (next `!echo "0\n1\n"`) +@ (collect) +@num +@ (try) +@ (bar num) +@ (catch u0 (arg)) +@ (output) +caught u0: @arg +@ (end) +@ (catch u1 (arg)) +@ (output) +caught u1: @arg +@ (end) +@ (end) +@ (end) +@(end) +@(foo) -- cgit v1.2.3