diff options
author | Araq <rumpf_a@web.de> | 2014-01-13 02:10:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-01-13 02:10:03 +0100 |
commit | 20b5f31c03fb556ec0aa2428a40adbac004d8987 (patch) | |
tree | 58086941e7d6bb8f480ca1173a95722ada9435b2 /tests/proc | |
parent | 51ee524109cf7e3e86c676bc1676063a01bfd979 (diff) | |
download | Nim-20b5f31c03fb556ec0aa2428a40adbac004d8987.tar.gz |
new tester; all tests categorized
Diffstat (limited to 'tests/proc')
-rw-r--r-- | tests/proc/tnestprc.nim | 16 | ||||
-rw-r--r-- | tests/proc/tprocredef.nim | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/proc/tnestprc.nim b/tests/proc/tnestprc.nim new file mode 100644 index 000000000..c10ad6abf --- /dev/null +++ b/tests/proc/tnestprc.nim @@ -0,0 +1,16 @@ +discard """ + file: "tnestprc.nim" + output: "10" +""" +# Test nested procs without closures + +proc Add3(x: int): int = + proc add(x, y: int): int {.noconv.} = + result = x + y + + result = add(x, 3) + +echo Add3(7) #OUT 10 + + + diff --git a/tests/proc/tprocredef.nim b/tests/proc/tprocredef.nim new file mode 100644 index 000000000..86ed92b62 --- /dev/null +++ b/tests/proc/tprocredef.nim @@ -0,0 +1,9 @@ +discard """ + file: "tprocredef.nim" + line: 8 + errormsg: "redefinition of \'foo\'" +""" + +proc foo(a: int, b: string) = nil +proc foo(a: int, b: string) = nil + |