summaryrefslogtreecommitdiff
path: root/test/colm.d/map4.lm
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-09-09 10:19:58 -0600
committerAdrian Thurston <thurston@colm.net>2019-09-09 10:19:58 -0600
commitfff52cd5a567ec541cd487b9fee2d89bf9b6f6eb (patch)
tree046a3f0f457343f7c99bf096863daf023a085051 /test/colm.d/map4.lm
parent2d8e9c3f5c0417d6237c945c50f92bf8d28b32d5 (diff)
downloadcolm-fff52cd5a567ec541cd487b9fee2d89bf9b6f6eb.tar.gz
base (aapl, colm, ragel) test cases building
Diffstat (limited to 'test/colm.d/map4.lm')
-rw-r--r--test/colm.d/map4.lm24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/colm.d/map4.lm b/test/colm.d/map4.lm
new file mode 100644
index 00000000..0327b4d2
--- /dev/null
+++ b/test/colm.d/map4.lm
@@ -0,0 +1,24 @@
+
+new M: map<int, str>()
+
+M->insert( 0, "hello" )
+M->insert( 1, "one" )
+M->insert( 2, "two" )
+M->insert( 3, "three" )
+M->insert( 4, "four" )
+
+M->remove( 3 )
+
+for V: str in M {
+ print "[V]
+}
+
+Two: str = M->find( 2 )
+print "[Two]
+
+##### EXP #####
+hello
+one
+two
+four
+two