Skip to content

Commit 900ae90

Browse files
committed
Test trailing multiple adjacent separators.
1 parent 275eaaf commit 900ae90

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/SwiftAlgorithmsTests/LazySplitCollectionTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ final class LazySplitCollectionTests: XCTestCase {
2727
XCTAssertEqualSequences(testResult, expectedResult)
2828
}
2929

30+
func testIntsWithTrailingMultipleAdjacentSeparators() {
31+
let nums = [1, 2, 42, 3, 4, 42, 42, 5, 6, 42, 7, 42, 42, 42]
32+
let expectedResult = nums.split(separator: 42)
33+
let testResult = nums.lazy.split(separator: 42)
34+
for nums in testResult { print(nums.debugDescription) }
35+
XCTAssertEqualSequences(testResult, expectedResult)
36+
}
37+
3038
func testString() {
3139
let path = "archive.tar.gz"
3240
let expectedResult = path.split(separator: ".")

0 commit comments

Comments
 (0)