add (never <pattern>) to case

This commit is contained in:
2022-09-25 20:16:11 +00:00
parent 5717ddb10f
commit d69175e58e
2 changed files with 23 additions and 6 deletions

View File

@@ -363,11 +363,11 @@ From:[(assert false (+ \"false \" \"should \" \"have \" \"been \" \"true\"))]" m
(function _testCase []
(case (toOption [])
(None (Assert.pass))
(otherwise (Assert.fail)))
(never otherwise))
(case (toOption "hey")
(None (Assert.fail))
(never None)
((Some "hey") (Assert.pass))
(otherwise (Assert.fail)))
(never otherwise))
(Assert.equals 5 (case (toOption 0)
(otherwise 5)))
// Test case with guards and multiple values