Skip to content

Commit 98feb5e

Browse files
authored
Add availability to a few new tests (swiftlang#40048)
its available, not availabile
1 parent 65f09cc commit 98feb5e

File tree

6 files changed

+19590
-691
lines changed

6 files changed

+19590
-691
lines changed

stdlib/private/StdlibUnicodeUnittest/StdlibUnicodeUnittest.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ public struct NormalizationTest {
7474
// file API...
7575
#if _runtime(_ObjC)
7676
import Foundation
77-
public let normalizationTests: [NormalizationTest] = {
77+
78+
func readInputNormalizationTest(index: Int) -> [NormalizationTest] {
7879
var tests = [NormalizationTest]()
7980

80-
let file = CommandLine.arguments[2]
81+
let file = CommandLine.arguments[index]
8182
let fileURL = URL(fileURLWithPath: file)
8283

8384
let fileContents = try! String(contentsOf: fileURL) + "" // go faster
@@ -111,7 +112,13 @@ public let normalizationTests: [NormalizationTest] = {
111112
}
112113

113114
return tests
114-
}()
115+
}
116+
117+
// Older version of stdlib with ICU and supporting Unicode 11
118+
public let normalizationTests = readInputNormalizationTest(index: 2)
119+
120+
// Native normalization in stdlib supporting Unicode 14
121+
public let normalizationTests14 = readInputNormalizationTest(index: 3)
115122
#endif
116123

117124
public struct UTFTest {

0 commit comments

Comments
 (0)