From 5629b81f78c722e8001b8cee1628085a78a8ea9f Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 15 Jun 2018 00:40:36 -0700 Subject: Updating tests. --- tests/errors.nom | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/errors.nom (limited to 'tests/errors.nom') diff --git a/tests/errors.nom b/tests/errors.nom new file mode 100644 index 0000000..1788a34 --- /dev/null +++ b/tests/errors.nom @@ -0,0 +1,22 @@ +# + Tests for the stuff defined in core/errors.nom + +try: barf +..and if it succeeds: barf "try failed." + +%worked <- (no) +try: barf +..and if it barfs: %worked <- (yes) +assume %worked or barf "try/catch failed" + +%x <- 1 +try + %x <- 2 + do + barf + ..then always + %x <- 3 +..and if it barfs: do nothing +assume (%x = 3) or barf "do/then always failed" + +say "Error handling test passed." -- cgit v1.2.3