aboutsummaryrefslogtreecommitdiff
path: root/tests/all.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-01-26 20:20:12 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2018-01-26 20:20:38 -0800
commit90c56d31352a0eeccd382ef5921baf3af4971040 (patch)
tree5167eafb5785c94b48458b18b0454222ca70c749 /tests/all.nom
parentd5aa4e52983712f9f4c5b23528d0c2dab12b0b33 (diff)
Added a ton of tests for virtually all the functionality. Helped me find
and fix a lot of latent problems.
Diffstat (limited to 'tests/all.nom')
-rw-r--r--tests/all.nom28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/all.nom b/tests/all.nom
new file mode 100644
index 0000000..5b95786
--- /dev/null
+++ b/tests/all.nom
@@ -0,0 +1,28 @@
+use "lib/core.nom"
+
+# Prerequisites:
+%var <- 99
+assume (%var = 99) or barf "Var assignment doesn't work."
+
+try: barf "barf"
+..and if it succeeds: barf "try % and if it succeeds failed."
+
+try: do nothing
+..and if it barfs: barf "try % and if it barfs failed."
+
+immediately
+ assume (%ONCE is (nil)) or barf "immediately is executing twice"
+ export %ONCE <- "ONCE"
+ %foo <- "immediately local"
+assume (%ONCE = "ONCE") or barf "Globals don't work."
+assume (%foo is (nil)) or barf "Immediately is leaking locals."
+
+# Run per-file test suites
+run file "tests/metaprogramming.nom"
+run file "tests/text.nom"
+run file "tests/operators.nom"
+run file "tests/control_flow.nom"
+run file "tests/math.nom"
+run file "tests/collections.nom"
+
+say "All tests passed!"