Skip to content

Commit 1e28851

Browse files
Another small test addition
1 parent a045364 commit 1e28851

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test_staticvec.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ fn filled_with() {
617617
assert_eq!(v[1], 2);
618618
assert_eq!(v[2], 3);
619619
assert_eq!(v[3], 4);
620+
let v2 = StaticVec::<i32, 64>::filled_with(|| { 0 });
621+
assert_eq!(v2.len(), 0);
622+
assert_eq!(v2.capacity(), 0);
623+
assert_eq!(v2.remaining_capacity(), 0);
620624
}
621625

622626
#[test]
@@ -627,6 +631,10 @@ fn filled_with_by_index() {
627631
assert_eq!(v[1], 2);
628632
assert_eq!(v[2], 3);
629633
assert_eq!(v[3], 4);
634+
let v2 = StaticVec::<usize, 0>::filled_with_by_index(|i| i + 1);
635+
assert_eq!(v2.len(), 0);
636+
assert_eq!(v2.capacity(), 0);
637+
assert_eq!(v2.remaining_capacity(), 0);
630638
}
631639

632640
#[test]

0 commit comments

Comments
 (0)