Add a test for vec::retain

This commit is contained in:
Seo Sanghyeon 2013-01-14 16:10:54 +09:00
parent 3d54187890
commit 23b130441a

View File

@ -2799,6 +2799,13 @@ mod tests {
assert filter(~[1u, 2u, 4u, 8u, 16u], is_three) == ~[];
}
#[test]
fn test_retain() {
let mut v = ~[1, 2, 3, 4, 5];
v.retain(is_odd);
assert v == ~[1, 3, 5];
}
#[test]
fn test_foldl() {
// Test on-stack fold.