Skip to content

Commit

Permalink
Rollup merge of rust-lang#87876 - lcnr:windows_no_panic, r=m-ou-se
Browse files Browse the repository at this point in the history
add `windows` count test

cc rust-lang#87767
  • Loading branch information
JohnTitor authored Aug 10, 2021
2 parents b9b8f5b + 24aa45c commit 9d21b5a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/core/tests/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,10 @@ fn test_array_windows_count() {
let v3: &[i32] = &[];
let c3 = v3.array_windows::<2>();
assert_eq!(c3.count(), 0);

let v4: &[()] = &[(); usize::MAX];
let c4 = v4.array_windows::<1>();
assert_eq!(c4.count(), usize::MAX);
}

#[test]
Expand Down Expand Up @@ -1050,6 +1054,10 @@ fn test_windows_count() {
let v3: &[i32] = &[];
let c3 = v3.windows(2);
assert_eq!(c3.count(), 0);

let v4 = &[(); usize::MAX];
let c4 = v4.windows(1);
assert_eq!(c4.count(), usize::MAX);
}

#[test]
Expand Down

0 comments on commit 9d21b5a

Please sign in to comment.