summary refs log tree commit diff stats
path: root/tests/tuples
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-01-13 02:10:03 +0100
committerAraq <rumpf_a@web.de>2014-01-13 02:10:03 +0100
commit20b5f31c03fb556ec0aa2428a40adbac004d8987 (patch)
tree58086941e7d6bb8f480ca1173a95722ada9435b2 /tests/tuples
parent51ee524109cf7e3e86c676bc1676063a01bfd979 (diff)
downloadNim-20b5f31c03fb556ec0aa2428a40adbac004d8987.tar.gz
new tester; all tests categorized
Diffstat (limited to 'tests/tuples')
-rw-r--r--tests/tuples/tanontuples.nim15
-rw-r--r--tests/tuples/twrongtupleaccess.nim10
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)
+