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/tuples | |
parent | 51ee524109cf7e3e86c676bc1676063a01bfd979 (diff) | |
download | Nim-20b5f31c03fb556ec0aa2428a40adbac004d8987.tar.gz |
new tester; all tests categorized
Diffstat (limited to 'tests/tuples')
-rw-r--r-- | tests/tuples/tanontuples.nim | 15 | ||||
-rw-r--r-- | tests/tuples/twrongtupleaccess.nim | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/tuples/tanontuples.nim b/tests/tuples/tanontuples.nim new file mode 100644 index 000000000..a2babf038 --- /dev/null +++ b/tests/tuples/tanontuples.nim @@ -0,0 +1,15 @@ +discard """ + output: "61, 125" +""" + +proc `^` (a, b: int): int = + result = 1 + for i in 1..b: result = result * a + +var m = (0, 5) +var n = (56, 3) + +m = (n[0] + m[1], m[1] ^ n[1]) + +echo m[0], ", ", m[1] + diff --git a/tests/tuples/twrongtupleaccess.nim b/tests/tuples/twrongtupleaccess.nim new file mode 100644 index 000000000..1a9ae64a2 --- /dev/null +++ b/tests/tuples/twrongtupleaccess.nim @@ -0,0 +1,10 @@ +discard """ + file: "twrongtupleaccess.nim" + line: 9 + errormsg: "undeclared identifier: \'setBLAH\'" +""" +# Bugfix + +var v = (5.0, 10.0) +v.setBLAH(10) + |