diff options
author | Araq <rumpf_a@web.de> | 2014-07-08 02:02:58 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-07-08 02:02:58 +0200 |
commit | f16449ec22751ca0e864d70424760e540a80c804 (patch) | |
tree | a6dc81d9b0ae81d925345e64b4d32ec611ac8d22 /tests/casestmt/tcase_arrayconstr.nim | |
parent | f9d7e8db2a8b89575df51768ce9e5aa66c47cc9f (diff) | |
download | Nim-f16449ec22751ca0e864d70424760e540a80c804.tar.gz |
fixes #1103; fixes #1297
Diffstat (limited to 'tests/casestmt/tcase_arrayconstr.nim')
-rw-r--r-- | tests/casestmt/tcase_arrayconstr.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/casestmt/tcase_arrayconstr.nim b/tests/casestmt/tcase_arrayconstr.nim new file mode 100644 index 000000000..cd7156600 --- /dev/null +++ b/tests/casestmt/tcase_arrayconstr.nim @@ -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) |