summary refs log tree commit diff stats
path: root/tests/run/tmemoization.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/tmemoization.nim')
-rw-r--r--tests/run/tmemoization.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/run/tmemoization.nim b/tests/run/tmemoization.nim
new file mode 100644
index 000000000..10db1fcf1
--- /dev/null
+++ b/tests/run/tmemoization.nim
@@ -0,0 +1,17 @@
+discard """
+  msg:    "test 1\ntest 2"
+  output: "TEST 1\nTEST 2\nTEST 2"
+"""
+
+import strutils
+
+proc foo(s: expr{string}): string =
+  static: echo s
+
+  const R = s.toUpper
+  return R
+  
+echo foo("test 1")
+echo foo("test 2")
+echo foo("test " & $2)
+