diff options
author | Araq <rumpf_a@web.de> | 2012-04-01 01:01:25 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-04-01 01:01:25 +0200 |
commit | f788f603feed91a1740e30852a56a2a6fda0ac05 (patch) | |
tree | 38c2dbb34a704bd97fe790d2f135a4346e617109 /tests/run/tmemoization.nim | |
parent | 3ef9f54cc128e8a4875803c5b686aedc06a397d1 (diff) | |
parent | 8d698b2bdd63cb7390a418d9ebb3ee7fdc7ea3b5 (diff) | |
download | Nim-f788f603feed91a1740e30852a56a2a6fda0ac05.tar.gz |
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'tests/run/tmemoization.nim')
-rw-r--r-- | tests/run/tmemoization.nim | 17 |
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) + |