parent
f9d7e8db2a
commit
f16449ec22
5 changed files with 137 additions and 31 deletions
19
tests/casestmt/tcase_arrayconstr.nim
Normal file
19
tests/casestmt/tcase_arrayconstr.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
output: '''Not found!
|
||||
Found!'''
|
||||
"""
|
||||
|
||||
const
|
||||
md_extension = [".md", ".markdown"]
|
||||
|
||||
proc test(ext: string) =
|
||||
case ext
|
||||
of ".txt", md_extension:
|
||||
echo "Found!"
|
||||
else:
|
||||
echo "Not found!"
|
||||
|
||||
test(".something")
|
||||
# ensure it's not evaluated at compile-time:
|
||||
var foo = ".markdown"
|
||||
test(foo)
|
||||
Loading…
Add table
Add a link
Reference in a new issue