diff options
| -rw-r--r-- | library/coretests/tests/iter/sources.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/library/coretests/tests/iter/sources.rs b/library/coretests/tests/iter/sources.rs index 506febaa056..5a391cb6775 100644 --- a/library/coretests/tests/iter/sources.rs +++ b/library/coretests/tests/iter/sources.rs @@ -31,6 +31,17 @@ fn test_repeat_take_collect() { } #[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)] struct NotClone(usize); |
