提交 d856215b 编写于 作者: D Daniel Micay

add a test for the chunk function

上级 0942c802
......@@ -469,4 +469,26 @@ fn test_each_reverse_break() {
n -= 1;
}
}
#[test]
fn test_sane_chunk() {
let x = 1;
let y = 1 << (uint::bits - 1);
let mut trie = TrieSet::new();
fail_unless!(trie.insert(x));
fail_unless!(trie.insert(y));
fail_unless!(trie.len() == 2);
let expected = [x, y];
let mut i = 0;
for trie.each |x| {
fail_unless!(expected[i] == *x);
i += 1;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册