Skip to content

Commit 02d45ba

Browse files
One more test addition
1 parent c173688 commit 02d45ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test_staticvec.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ impl Drop for ZST {
115115
}
116116
}
117117

118+
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
119+
struct CloneableZST;
120+
118121
#[test]
119122
fn append() {
120123
let mut a = staticvec![
@@ -1438,6 +1441,14 @@ fn into_iter() {
14381441
iter2.next();
14391442
let iter3 = iter2.clone();
14401443
assert_eq!(iter2.as_slice(), iter3.as_slice());
1444+
// Needs to work properly with ZSTs too of course.
1445+
let a5 = staticvec![CloneableZST, CloneableZST, CloneableZST, CloneableZST, CloneableZST, CloneableZST];
1446+
let mut iter4 = a5.into_iter();
1447+
iter4.nth(0);
1448+
iter4.next_back();
1449+
iter4.next();
1450+
let iter5 = iter4.clone();
1451+
assert_eq!(iter4.as_slice(), iter5.as_slice());
14411452
}
14421453

14431454
#[test]

0 commit comments

Comments
 (0)