From f16449ec22751ca0e864d70424760e540a80c804 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 8 Jul 2014 02:02:58 +0200 Subject: fixes #1103; fixes #1297 --- tests/casestmt/tcase_arrayconstr.nim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/casestmt/tcase_arrayconstr.nim (limited to 'tests/casestmt/tcase_arrayconstr.nim') 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) -- cgit 1.4.1-2-gfad0