Merge pull request #4484 from sanxiyn/test-retain
Add a test for vec::retain
This commit is contained in:
commit
e699058511
1 changed files with 7 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue