Rollup merge of #147195 - hkBst:repeat-3, r=Mark-Simulacrum
iter repeat: add tests for new count and last behavior Tests for https://github.com/rust-lang/rust/pull/146410
This commit is contained in:
commit
1feb547a52
1 changed files with 11 additions and 0 deletions
|
|
@ -30,6 +30,17 @@ fn test_repeat_take_collect() {
|
|||
assert_eq!(v, vec![42, 42, 42]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic = "iterator is infinite"]
|
||||
fn test_repeat_count() {
|
||||
repeat(42).count();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_repeat_last() {
|
||||
assert_eq!(repeat(42).last(), Some(42));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_repeat_with() {
|
||||
#[derive(PartialEq, Debug)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue