From 810ae220bc2b1dfa07593b77f391e4da3b57a6bb Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 6 Jun 2018 13:25:01 -0700 Subject: Added list/dict metatables to make comparison and string representations simpler. Also deleted Counters. --- tests/collections.nom | 4 ---- tests/metaprogramming.nom | 6 ++---- tests/text.nom | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/collections.nom b/tests/collections.nom index 6329d00..2cc6adf 100644 --- a/tests/collections.nom +++ b/tests/collections.nom @@ -37,9 +37,5 @@ assume (%x = [3,2,1]) sort %x by % = %keys.% assume (%x = [2,3,1]) assume ((unique [1,2,1,3,2,3]) = [1,2,3]) -%c <- (new counter) -for % in ["x","y","x","x","y"] - %c.% +<- 1 -assume (%c = {x:3,y:2}) say "Collections test passed." diff --git a/tests/metaprogramming.nom b/tests/metaprogramming.nom index 26a750a..b9b97af 100644 --- a/tests/metaprogramming.nom +++ b/tests/metaprogramming.nom @@ -55,15 +55,13 @@ try: foo 99 assume ((\(5 + 5) as value) = 10) or barf "%tree as value failed." -assume (((\(foo %x) as nomsu) as text) = "foo %x") or barf "source code failed." - -assume ((repr [1,2]) = "{1, 2}") or barf "repr failed." +assume ("\(\(foo %x) as nomsu)" = "foo %x") or barf "source code failed." assume ((type of {}) = "table") or barf "type of failed." assume ((nomsu) = (=lua "nomsu")) or barf "nomsu failed" -assume (((\%x as lua identifier) as text) = "_x") or barf "converting to identifier failed." +assume ("\(\%x as lua identifier)" = "_x") or barf "converting to identifier failed." assume ((run "return 99") = 99) or barf "run % failed." diff --git a/tests/text.nom b/tests/text.nom index f2ef225..600cce4 100644 --- a/tests/text.nom +++ b/tests/text.nom @@ -30,7 +30,7 @@ assume (%s = "one two\\nthreefour") list:\[..] 1,2,3 .. -assume (%s = "list:{1, 2, 3}") +assume (%s = "list:[1, 2, 3]") assume ".." -- cgit v1.2.3