Skip to content

Commit 24aa45c

Browse files
committed
add windows count test
1 parent 7f3dc04 commit 24aa45c

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)