summary refs log tree commit diff stats
path: root/tests/run/tseqtuple.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-11-19 15:45:51 +0100
committerAraq <rumpf_a@web.de>2011-11-19 15:45:51 +0100
commita274f3bf5be3fc35f1538e5aab0e32fb9ed2ff82 (patch)
tree95dc5bf7fe3716a3ab266f78094fccce38c94ccf /tests/run/tseqtuple.nim
parentd0772feb08baaea12bfdad0a7c20a41733f977bd (diff)
downloadNim-a274f3bf5be3fc35f1538e5aab0e32fb9ed2ff82.tar.gz
got rid of 'accept' dir in the tests
Diffstat (limited to 'tests/run/tseqtuple.nim')
-rwxr-xr-xtests/run/tseqtuple.nim28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/run/tseqtuple.nim b/tests/run/tseqtuple.nim
new file mode 100755
index 000000000..7ef92f7f1
--- /dev/null
+++ b/tests/run/tseqtuple.nim
@@ -0,0 +1,28 @@
+discard """
+  file: "tseqtuple.nim"
+  output: "fA13msg1falsefB14msg2truefC15msg3false"
+"""
+
+type
+  TMsg = tuple[
+    file: string,
+    line: int,       
+    msg: string,
+    err: bool]
+
+var s: seq[TMsg] = @[]
+
+s.add(("fA", 13, "msg1", false))
+s.add(("fB", 14, "msg2", true))
+s.add(("fC", 15, "msg3", false))
+
+for file, line, msg, err in items(s):
+  stdout.write(file)
+  stdout.write($line)
+  stdout.write(msg)
+  stdout.write($err)
+
+#OUT fA13msg1falsefB14msg2truefC15msg3false
+
+
+