Skip to content

Commit 3aa1831

Browse files
[tests] Using unique permutations in tests
1 parent aaf77c8 commit 3aa1831

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

Tests/SwiftAlgorithmsTests/CompactedTests.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,10 @@ import Algorithms
1414

1515
final class CompactedTests: XCTestCase {
1616

17-
var tests: [[Int?]] = [
18-
[],
19-
[0],
20-
[nil],
21-
[0, nil],
22-
[nil, 0],
23-
[0, nil, 1, nil, 2, nil],
24-
[0, 1, 2, nil, nil, nil],
25-
[nil, nil, nil, 0, 1, 2],
26-
[nil, nil, nil, nil, nil, nil]
27-
]
17+
let tests: [[Int?]] =
18+
[nil, nil, nil, 0, 1, 2]
19+
.uniquePermutations(ofCount: 0...)
20+
.map(Array.init)
2821

2922
func testCompactedSequence() {
3023
for array in self.tests {

0 commit comments

Comments
 (0)