Skip to content

Commit 9d21b5a

Browse files
authored
Rollup merge of #87876 - lcnr:windows_no_panic, r=m-ou-se
add `windows` count test cc #87767
2 parents b9b8f5b + 24aa45c commit 9d21b5a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/core/tests/slice.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,10 @@ fn test_array_windows_count() {
739739
let v3: &[i32] = &[];
740740
let c3 = v3.array_windows::<2>();
741741
assert_eq!(c3.count(), 0);
742+
743+
let v4: &[()] = &[(); usize::MAX];
744+
let c4 = v4.array_windows::<1>();
745+
assert_eq!(c4.count(), usize::MAX);
742746
}
743747

744748
#[test]
@@ -1050,6 +1054,10 @@ fn test_windows_count() {
10501054
let v3: &[i32] = &[];
10511055
let c3 = v3.windows(2);
10521056
assert_eq!(c3.count(), 0);
1057+
1058+
let v4 = &[(); usize::MAX];
1059+
let c4 = v4.windows(1);
1060+
assert_eq!(c4.count(), usize::MAX);
10531061
}
10541062

10551063
#[test]

0 commit comments

Comments
 (0)