Skip to content

Commit 9e09bf8

Browse files
committed
Test to ensure stdlib split is still accessible
1 parent e81a8bd commit 9e09bf8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Tests/RegexTests/AlgorithmsTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ class AlgorithmTests: XCTestCase {
135135
expectSplit("a", "a", ["", ""])
136136
expectSplit("a____a____a", "_+", ["a", "a", "a"])
137137
expectSplit("____a____a____a____", "_+", ["", "a", "a", "a", ""])
138+
139+
// Test that original `split` functions are still accessible
140+
let splitRef = "abcd".split
141+
XCTAssert(type(of: splitRef) == ((Character, Int, Bool) -> [Substring]).self)
142+
let splitParamsRef = "abcd".split(separator:maxSplits:omittingEmptySubsequences:)
143+
XCTAssert(type(of: splitParamsRef) == ((Character, Int, Bool) -> [Substring]).self)
138144
}
139145

140146
func testSplitPermutations() throws {

0 commit comments

Comments
 (0)