summary refs log tree commit diff stats
path: root/tests/run/tmemoization.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-04-01 01:01:25 +0200
committerAraq <rumpf_a@web.de>2012-04-01 01:01:25 +0200
commitf788f603feed91a1740e30852a56a2a6fda0ac05 (patch)
tree38c2dbb34a704bd97fe790d2f135a4346e617109 /tests/run/tmemoization.nim
parent3ef9f54cc128e8a4875803c5b686aedc06a397d1 (diff)
parent8d698b2bdd63cb7390a418d9ebb3ee7fdc7ea3b5 (diff)
downloadNim-f788f603feed91a1740e30852a56a2a6fda0ac05.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
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)
+