summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authordom96 <dominikpicheta@googlemail.com>2011-01-28 00:07:08 +0000
committerdom96 <dominikpicheta@googlemail.com>2011-01-28 00:07:08 +0000
commit557adbcaac45d7b9c92904349c6cc3a7a8282ed7 (patch)
treefe099c599b674643bb61ed5da5043c3e56b48826 /tests
parent4b7ff3e0902c92b3483bd1000a8d4fb3f2bf8077 (diff)
parent408eb6bbe76e9e1b0651d07467ce2ba9510deb23 (diff)
downloadNim-557adbcaac45d7b9c92904349c6cc3a7a8282ed7.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'tests')
-rwxr-xr-xtests/accept/run/spec.csv1
-rw-r--r--tests/accept/run/tarraycons.nim17
-rw-r--r--tests/gc/tthreads.nim21
-rwxr-xr-xtests/reject/spec.csv1
-rw-r--r--tests/reject/tarraycons.nim17
5 files changed, 57 insertions, 0 deletions
diff --git a/tests/accept/run/spec.csv b/tests/accept/run/spec.csv
index 7a3d2bd98..09dbc40b3 100755
--- a/tests/accept/run/spec.csv
+++ b/tests/accept/run/spec.csv
@@ -2,6 +2,7 @@ tack.nim;125
 tambsym2.nim;7
 tambsys.nim;
 tarray.nim;10012
+tarraycons.nim;6
 tarray2.nim;[16, 25, 36]
 tarray3.nim;3
 tassert.nim;assertion failure!this shall be always written
diff --git a/tests/accept/run/tarraycons.nim b/tests/accept/run/tarraycons.nim
new file mode 100644
index 000000000..12f13ac33
--- /dev/null
+++ b/tests/accept/run/tarraycons.nim
@@ -0,0 +1,17 @@
+
+type
+  TEnum = enum
+    eA, eB, eC, eD, eE, eF
+    
+const
+  myMapping: array[TEnum, array[0..1, int]] = [
+    eA: [1, 2],
+    eB: [3, 4],
+    [5, 6],
+    eD: [0: 8, 1: 9],
+    eE: [0: 8, 9],
+    eF: [2, 1: 9]
+  ]
+
+echo myMapping[eC][1]
+
diff --git a/tests/gc/tthreads.nim b/tests/gc/tthreads.nim
new file mode 100644
index 000000000..2ef599e53
--- /dev/null
+++ b/tests/gc/tthreads.nim
@@ -0,0 +1,21 @@
+
+import threads
+
+var
+  thr: array [0..4, TThread]
+  L: TLock
+  
+proc threadFunc(c: pointer) {.procvar.} = 
+  for i in 0..9: 
+    Aquire(L)
+    echo i
+    Release(L)
+
+InitLock(L)
+
+for i in 0..high(thr):
+  createThread(thr[i], threadFunc)
+for i in 0..high(thr):
+  joinThread(thr[i])
+
+
diff --git a/tests/reject/spec.csv b/tests/reject/spec.csv
index a332096b2..f2d38f03b 100755
--- a/tests/reject/spec.csv
+++ b/tests/reject/spec.csv
@@ -3,6 +3,7 @@ tadrdisc.nim;15;for a 'var' type a variable needs to be passed
 tambsym.nim;6;ambiguous identifier
 tambsym2.nim;4;undeclared identifier: 'CreateRGBSurface'
 tambsym3.nim;6;ambiguous identifier
+tarraycons.nim;9;invalid order in array constructor
 tatomic.nim;2;identifier expected, but found 'atomic'
 tbind2.nim;7;ambiguous call
 tbind4.nim;4;undeclared identifier: 'lastId'
diff --git a/tests/reject/tarraycons.nim b/tests/reject/tarraycons.nim
new file mode 100644
index 000000000..1809f8735
--- /dev/null
+++ b/tests/reject/tarraycons.nim
@@ -0,0 +1,17 @@
+
+type
+  TEnum = enum
+    eA, eB, eC, eD, eE, eF
+    
+const
+  myMapping: array[TEnum, array[0..1, int]] = [
+    eA: [1, 2],
+    eC: [3, 4],
+    eB: [5, 6],
+    eD: [0: 8, 1: 9],
+    eE: [0: 8, 9],
+    eF: [2, 1: 9]
+  ]
+
+echo myMapping[eC][1]
+