summary refs log tree commit diff stats
path: root/tests/actiontable
diff options
context:
space:
mode:
authorMiran <narimiran@users.noreply.github.com>2018-10-12 17:02:46 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-12 17:02:46 +0200
commit7f18d7cbc1fc8ad87c389b8d4d873e1d1169f794 (patch)
tree8c4839495fd6fc10376dc44cc8f9c7e3c625d18f /tests/actiontable
parentd2b04a8bc7a78845d25e8b789184ae54e98073ec (diff)
downloadNim-7f18d7cbc1fc8ad87c389b8d4d873e1d1169f794.tar.gz
Merge tests into a larger file (part 1 of ∞) (#9318)
* merge actiontable tests

* merge arithm tests

* merge array tests

* merge assign tests

* merge bind tests

* merge casestmt tests

* merge closure tests

* merge cnt seq tests

* merge collections tests

* merge concept issues tests

* merge concept tests

* fix failing tests

* smaller outputs

Use `doAssert` where possible.

* fix wrong output

* split `tcomputedgoto`

* revert merging concepts

* fix failing test
Diffstat (limited to 'tests/actiontable')
-rw-r--r--tests/actiontable/tactiontable.nim17
-rw-r--r--tests/actiontable/tactiontable2.nim27
2 files changed, 14 insertions, 30 deletions
diff --git a/tests/actiontable/tactiontable.nim b/tests/actiontable/tactiontable.nim
index 4560d0f7f..3f15a70bd 100644
--- a/tests/actiontable/tactiontable.nim
+++ b/tests/actiontable/tactiontable.nim
@@ -1,5 +1,8 @@
 discard """
-  output: "action 3 arg"
+  output: '''
+action 3 arg
+action 3 arg
+'''
 """
 
 import tables
@@ -17,10 +20,18 @@ proc action4(arg: string) =
   echo "action 4 ", arg
 
 var
-  actionTable = {
+  actionTable1 = {
     "A": action1,
     "B": action2,
     "C": action3,
     "D": action4}.toTable
 
-actionTable["C"]("arg")
+const
+  actionTable2 = {
+    "A": action1,
+    "B": action2,
+    "C": action3,
+    "D": action4}.toTable
+
+actionTable1["C"]("arg")
+actionTable2["C"]("arg")
diff --git a/tests/actiontable/tactiontable2.nim b/tests/actiontable/tactiontable2.nim
deleted file mode 100644
index fbc65a67d..000000000
--- a/tests/actiontable/tactiontable2.nim
+++ /dev/null
@@ -1,27 +0,0 @@
-discard """
-  output: "action 3 arg"
-"""
-
-import tables
-
-proc action1(arg: string) =
-  echo "action 1 ", arg
-
-proc action2(arg: string) =
-  echo "action 2 ", arg
-
-proc action3(arg: string) =
-  echo "action 3 ", arg
-
-proc action4(arg: string) =
-  echo "action 4 ", arg
-
-const
-  actionTable = {
-    "A": action1,
-    "B": action2,
-    "C": action3,
-    "D": action4}.toTable
-
-actionTable["C"]("arg")
-