9
9
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
10
//
11
11
//===----------------------------------------------------------------------===//
12
- // RUN: mkdir -p %t
13
- // RUN: %target-build-swift %s -o %t/a.out
12
+ // RUN: %empty-directory(%t)
13
+ // RUN: if [ %target-runtime == "objc" ]; \
14
+ // RUN: then \
15
+ // RUN: %target-clang -fobjc-arc %S/Inputs/NSSlowString/NSSlowString.m -c -o %t/NSSlowString.o && \
16
+ // RUN: %target-build-swift -I %S/Inputs/NSSlowString/ %t/NSSlowString.o %s -o %t/a.out; \
17
+ // RUN: else \
18
+ // RUN: %target-build-swift %s -o %t/a.out; \
19
+ // RUN: fi
20
+
21
+ // RUN: %target-codesign %t/a.out
14
22
// RUN: %target-run %t/a.out %S/Inputs/NormalizationTest.txt
15
23
// REQUIRES: executable_test
16
24
// REQUIRES: objc_interop
@@ -19,6 +27,10 @@ import Swift
19
27
import StdlibUnittest
20
28
import StdlibUnicodeUnittest
21
29
30
+ #if _runtime(_ObjC)
31
+ import NSSlowString
32
+ #endif
33
+
22
34
private func expectEqualIterators(
23
35
label: String ,
24
36
expected: [ UInt8 ] ,
@@ -453,6 +465,18 @@ for (i, test) in codeUnitNormalizationTests.enumerated() {
453
465
let codeUnits = test. 1 . _nfcCodeUnits
454
466
expectEqual ( test. 0 , codeUnits)
455
467
}
468
+ #if _runtime(_ObjC)
469
+ tests. test ( " CodeUnitNormalizationTest# \( i) /Opaque " )
470
+ . skip ( . custom( {
471
+ if #available( macOS 10 . 14 , iOS 12 , watchOS 5 , tvOS 12 , * ) { return false }
472
+ return true
473
+ } , reason: " NormalizationTest.txt requires Unicode 11 " ) )
474
+ . code {
475
+ let opaqueString = NSSlowString ( string: test. 1 ) as String
476
+ let codeUnits = opaqueString. _nfcCodeUnits
477
+ expectEqual ( test. 0 , codeUnits)
478
+ }
479
+ #endif
456
480
}
457
481
458
482
runAllTests ( )
0 commit comments