Skip to content

Commit 2371c78

Browse files
feat: Add test to increase coverage of naive permutations (#687)
* feat: add test to cover empty array in naive * tests: check `permute` against empty input --------- Co-authored-by: Piotr Idzik <[email protected]>
1 parent 9fd07b3 commit 2371c78

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/general/permutations/naive.rs

+7
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ mod tests {
9696
}
9797
}
9898

99+
#[test]
100+
fn empty_array() {
101+
let empty: std::vec::Vec<u8> = vec![];
102+
assert_eq!(permute(&empty), vec![vec![]]);
103+
assert_eq!(permute_unique(&empty), vec![vec![]]);
104+
}
105+
99106
#[test]
100107
fn test_3_times_the_same_value() {
101108
let original = vec![1, 1, 1];

0 commit comments

Comments
 (0)