diff options
Diffstat (limited to '')
-rw-r--r-- | new-luxc/test/test/luxc/analyser/case.lux | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/new-luxc/test/test/luxc/analyser/case.lux b/new-luxc/test/test/luxc/analyser/case.lux index 3fe67b7a3..037f99feb 100644 --- a/new-luxc/test/test/luxc/analyser/case.lux +++ b/new-luxc/test/test/luxc/analyser/case.lux @@ -120,7 +120,7 @@ (r/wrap (code;record (list;zip2 record-tags primitivesC))) )))) -(test: "Pattern-matching." +(context: "Pattern-matching." #seed +9253409297339902486 [module-name (r;text +5) variant-name (r;text +5) @@ -142,35 +142,35 @@ non-total-branchesC (list;take (n.dec (list;size total-branchesC)) total-branchesC)]] ($_ seq - (assert "Will reject empty pattern-matching (no branches)." - (|> (&;with-scope - (&;with-expected-type outputT - (@;analyse-case analyse inputC (list)))) - check-failure)) - (assert "Can analyse total pattern-matching." - (|> (@module;with-module +0 module-name - (do Monad<Lux> - [_ (@module;declare-tags variant-tags false - (#;Named [module-name variant-name] - (type;variant primitivesT))) - _ (@module;declare-tags record-tags false - (#;Named [module-name record-name] - (type;tuple primitivesT)))] - (&;with-scope - (&;with-expected-type outputT - (@;analyse-case analyse inputC total-branchesC))))) - check-success)) - (assert "Will reject non-total pattern-matching." - (|> (@module;with-module +0 module-name - (do Monad<Lux> - [_ (@module;declare-tags variant-tags false - (#;Named [module-name variant-name] - (type;variant primitivesT))) - _ (@module;declare-tags record-tags false - (#;Named [module-name record-name] - (type;tuple primitivesT)))] - (&;with-scope - (&;with-expected-type outputT - (@;analyse-case analyse inputC non-total-branchesC))))) - check-failure)) + (test "Will reject empty pattern-matching (no branches)." + (|> (&;with-scope + (&;with-expected-type outputT + (@;analyse-case analyse inputC (list)))) + check-failure)) + (test "Can analyse total pattern-matching." + (|> (@module;with-module +0 module-name + (do Monad<Lux> + [_ (@module;declare-tags variant-tags false + (#;Named [module-name variant-name] + (type;variant primitivesT))) + _ (@module;declare-tags record-tags false + (#;Named [module-name record-name] + (type;tuple primitivesT)))] + (&;with-scope + (&;with-expected-type outputT + (@;analyse-case analyse inputC total-branchesC))))) + check-success)) + (test "Will reject non-total pattern-matching." + (|> (@module;with-module +0 module-name + (do Monad<Lux> + [_ (@module;declare-tags variant-tags false + (#;Named [module-name variant-name] + (type;variant primitivesT))) + _ (@module;declare-tags record-tags false + (#;Named [module-name record-name] + (type;tuple primitivesT)))] + (&;with-scope + (&;with-expected-type outputT + (@;analyse-case analyse inputC non-total-branchesC))))) + check-failure)) )) |