diff options
author | Adrian Thurston <thurston@complang.org> | 2015-02-12 16:48:05 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-02-12 16:48:05 -0500 |
commit | a77f7d3b4be06c6a070bdba46847c646caa70a75 (patch) | |
tree | 585811441a276d3521ec99069370454696f36c4b /test | |
parent | 506049393a53781a389fb17b6010b863e5df5677 (diff) | |
download | colm-a77f7d3b4be06c6a070bdba46847c646caa70a75.tar.gz |
added tests for list and map iteration
Diffstat (limited to 'test')
-rw-r--r-- | test/list2.lm | 17 | ||||
-rw-r--r-- | test/map1.lm | 24 |
2 files changed, 41 insertions, 0 deletions
diff --git a/test/list2.lm b/test/list2.lm new file mode 100644 index 00000000..e603bdbb --- /dev/null +++ b/test/list2.lm @@ -0,0 +1,17 @@ + +struct el + map_el<str> el +end + +new M: map<str el>() + +for AE: argv_el in argv { + print "[AE->value] +} + +##### ARGS ##### +a b c +##### EXP ##### +a +b +c diff --git a/test/map1.lm b/test/map1.lm new file mode 100644 index 00000000..9d68c307 --- /dev/null +++ b/test/map1.lm @@ -0,0 +1,24 @@ + +struct el + map_el<str> el +end + +new M: map<str el>() + +AE: argv_el = argv->head +while AE { + new El: el() + El->key = AE->value + M->insert( El ) + AE = AE->next +} + +for El: el in M { + print "[El->key] +} +##### ARGS ##### +a b c +##### EXP ##### +a +b +c |