diff options
author | Ori Bernstein <ori@eigenstate.org> | 2014-11-04 21:53:47 -0500 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2014-11-04 21:53:47 -0500 |
commit | be5462a429323b0c69e9cb4061bdc520be9727c1 (patch) | |
tree | b658190273c2d17a07ebbb1c2b55975c044bae58 /test | |
parent | 09af6b8f6597c29208b8725b4f67bd7ed6d45e85 (diff) | |
download | mc-be5462a429323b0c69e9cb4061bdc520be9727c1.tar.gz |
Fix most tests.
Matching constants is still buggered.
Diffstat (limited to 'test')
-rw-r--r-- | test/genericret.myr | 1 | ||||
-rw-r--r-- | test/generictype.myr | 1 | ||||
-rw-r--r-- | test/matchargstr.myr | 1 | ||||
-rw-r--r-- | test/matchargunion.myr | 9 | ||||
-rw-r--r-- | test/matchbind.myr | 1 | ||||
-rw-r--r-- | test/matchint.myr | 1 | ||||
-rw-r--r-- | test/matchunion_sl.myr | 1 | ||||
-rw-r--r-- | test/nestucon.myr | 1 | ||||
-rw-r--r-- | test/stdsearch.myr | 1 |
9 files changed, 13 insertions, 4 deletions
diff --git a/test/genericret.myr b/test/genericret.myr index d53de5d..08dd2b3 100644 --- a/test/genericret.myr +++ b/test/genericret.myr @@ -12,6 +12,7 @@ const f = {-> t(int) const main = { match f() | `None: std.exit(42) + | _: std.die("Impossible match failure\n"); ;; std.exit(0) } diff --git a/test/generictype.myr b/test/generictype.myr index f4046bf..99915b3 100644 --- a/test/generictype.myr +++ b/test/generictype.myr @@ -13,6 +13,7 @@ const main = { match v | `None: std.exit(1) | `Some 123: std.exit(0) + | `Some _: std.die("Impossible match failure\n") ;; std.exit(60) } diff --git a/test/matchargstr.myr b/test/matchargstr.myr index 6c87821..50d539b 100644 --- a/test/matchargstr.myr +++ b/test/matchargstr.myr @@ -17,6 +17,7 @@ const main = { | `Str "fsda": std.fatal(1, "Wrong match `Str \"fsda\"\n") | `Str "asdf": std.put("Correct `Str \"asdf\"!\n") | `Nil: std.fatal(1, "Wrong match `Str \"fsda\"\n") + | _: std.fatal(1, "Impossible failed match\n") ;; } diff --git a/test/matchargunion.myr b/test/matchargunion.myr index 7d12706..f5ae799 100644 --- a/test/matchargunion.myr +++ b/test/matchargunion.myr @@ -12,10 +12,11 @@ const main = { v = `Int 123 match v - | `Int 127: std.exit(42) - | `Int 123: std.exit(69) - | `Chr 'a': std.exit(4) - | `Nil: std.exit(6) + | `Int 127: std.exit(42) + | `Int 123: std.exit(69) + | `Chr 'a': std.exit(4) + | `Nil: std.exit(6) + | _: std.die("Impossible failed match\n") ;; } diff --git a/test/matchbind.myr b/test/matchbind.myr index 2bcc780..bddd4ac 100644 --- a/test/matchbind.myr +++ b/test/matchbind.myr @@ -16,6 +16,7 @@ const main = { | `Int x: std.exit(x) | `Chr 'a': std.exit(4) | `Nil: std.exit(6) + | x: std.die("Impossible match failure\n") ;; } diff --git a/test/matchint.myr b/test/matchint.myr index 5fc3eb4..a8f59e8 100644 --- a/test/matchint.myr +++ b/test/matchint.myr @@ -11,5 +11,6 @@ const main = { | 4: std.exit(99) | 12: std.exit(84) | 6: std.exit(18) + | x: std.die("Got an unexpected int!\n") ;; } diff --git a/test/matchunion_sl.myr b/test/matchunion_sl.myr index 3a4ddb3..e8f9dd7 100644 --- a/test/matchunion_sl.myr +++ b/test/matchunion_sl.myr @@ -15,6 +15,7 @@ const main = { | `Int 127: std.exit(42) | `Str s: std.put("%s\n", s) | `Nil: + | _: std.die("Impossible match failure\n") ;; } diff --git a/test/nestucon.myr b/test/nestucon.myr index 1939000..deee01e 100644 --- a/test/nestucon.myr +++ b/test/nestucon.myr @@ -13,6 +13,7 @@ const main = { a = [.x = `Str "asdf"] match a | [.x=`Str s]: std.put("%s\n", s) + | _: std.die("Impossible match failure\n") ;; } diff --git a/test/stdsearch.myr b/test/stdsearch.myr index c6f0231..3e3ac53 100644 --- a/test/stdsearch.myr +++ b/test/stdsearch.myr @@ -20,6 +20,7 @@ const expect = {a, b | `std.None: match b | `std.Some x: std.fatal(1, "Expected `std.None, `std.None, got `std.None, `std.Some %i\n", x) + | `std.None: /* nothing */ ;; | `std.Some x: match b |