new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
30
tests/casestmt/tcaseexpr1.nim
Normal file
30
tests/casestmt/tcaseexpr1.nim
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
discard """
|
||||
file: "tcaseexpr1.nim"
|
||||
|
||||
line: 29
|
||||
errormsg: "type mismatch: got (string) but expected 'int'"
|
||||
|
||||
line: 23
|
||||
errormsg: "not all cases are covered"
|
||||
"""
|
||||
|
||||
type
|
||||
E = enum A, B, C
|
||||
|
||||
proc foo(x): auto =
|
||||
return case x
|
||||
of 1..9: "digit"
|
||||
else: "number"
|
||||
|
||||
var r = foo(10)
|
||||
|
||||
var x = C
|
||||
|
||||
var t1 = case x:
|
||||
of A: "a"
|
||||
of B: "b"
|
||||
|
||||
var t2 = case x:
|
||||
of A: 10
|
||||
of B, C: "23"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue