Skip to content

Commit

Permalink
Incorporate a stray test
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Jul 27, 2018
1 parent 3d0e933 commit b326e71
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/liballoc/repeat-generic-slice.rs

This file was deleted.

1 change: 1 addition & 0 deletions src/liballoc/tests/lib.rs
Expand Up @@ -24,6 +24,7 @@
#![feature(try_reserve)]
#![feature(unboxed_closures)]
#![feature(exact_chunks)]
#![feature(repeat_generic_slice)]

extern crate alloc_system;
extern crate core;
Expand Down
11 changes: 11 additions & 0 deletions src/liballoc/tests/slice.rs
Expand Up @@ -1529,3 +1529,14 @@ fn panic_safe() {
}
}
}

#[test]
fn repeat_generic_slice() {
assert_eq!([1, 2].repeat(2), vec![1, 2, 1, 2]);
assert_eq!([1, 2, 3, 4].repeat(0), vec![]);
assert_eq!([1, 2, 3, 4].repeat(1), vec![1, 2, 3, 4]);
assert_eq!(
[1, 2, 3, 4].repeat(3),
vec![1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
);
}

0 comments on commit b326e71

Please sign in to comment.