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/actiontable/tactiontable.nim | |
parent | 51ee524109cf7e3e86c676bc1676063a01bfd979 (diff) | |
download | Nim-20b5f31c03fb556ec0aa2428a40adbac004d8987.tar.gz |
new tester; all tests categorized
Diffstat (limited to 'tests/actiontable/tactiontable.nim')
-rw-r--r-- | tests/actiontable/tactiontable.nim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/actiontable/tactiontable.nim b/tests/actiontable/tactiontable.nim new file mode 100644 index 000000000..e2f19a099 --- /dev/null +++ b/tests/actiontable/tactiontable.nim @@ -0,0 +1,27 @@ +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 + +var + actionTable = { + "A": action1, + "B": action2, + "C": action3, + "D": action4}.toTable + +actionTable["C"]("arg") + |