summary refs log tree commit diff stats
path: root/tests/casestmt/tcase_arrayconstr.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/casestmt/tcase_arrayconstr.nim')
-rw-r--r--tests/casestmt/tcase_arrayconstr.nim19
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)