Merge pull request #4484 from sanxiyn/test-retain
Add a test for vec::retain
This commit is contained in:
commit
e699058511
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user