Merge pull request #4484 from sanxiyn/test-retain

Add a test for vec::retain
This commit is contained in:
Brian Anderson 2013-01-14 14:09:17 -08:00
commit e699058511

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.