提交 5c0cc474 编写于 作者: E Eric Holk

stdlib: more test cases for treemap.

上级 2fab948e
......@@ -2,6 +2,7 @@
import std::treemap::*;
import std::option::some;
import std::option::none;
import std::str;
#[test]
fn init_treemap() {
......@@ -56,4 +57,18 @@ fn t(n : &mutable int, k : &int, v : &()) {
n += 1;
}
traverse(m, bind t(n, _, _));
}
\ No newline at end of file
}
#[test]
fn u8_map() {
let m = init();
let k1 = str::bytes("foo");
let k2 = str::bytes("bar");
insert(m, k1, "foo");
insert(m, k2, "bar");
assert(find(m, k2) == some("bar"));
assert(find(m, k1) == some("foo"));
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册