|
18 | 18 | //
|
19 | 19 | // REQUIRES: objc_interop
|
20 | 20 |
|
| 21 | +// The UIKit overlay isn't present on iOS 10.3. |
| 22 | +// UNSUPPORTED: CPU=i386 |
| 23 | + |
21 | 24 | import StdlibUnittest
|
22 | 25 | import StdlibUnittestFoundationExtras
|
23 | 26 | import Foundation
|
24 | 27 | import CoreGraphics
|
25 | 28 |
|
| 29 | +#if os(iOS) || os(tvOS) || os(watchOS) |
| 30 | +import UIKit |
| 31 | +#endif |
| 32 | + |
26 | 33 | var nsValueBridging = TestSuite("NSValueBridging")
|
27 | 34 |
|
28 | 35 | func rangesEqual(_ x: NSRange, _ y: NSRange) -> Bool {
|
@@ -66,6 +73,16 @@ ${ testCase("CGAffineTransform", "CGAffineTransform(rotationAngle: .pi)", N
|
66 | 73 |
|
67 | 74 | #endif
|
68 | 75 |
|
| 76 | +#if os(iOS) || os(tvOS) || os(watchOS) |
| 77 | + |
| 78 | +${ testCase("CGRect", "CGRect(x: 17, y: 38, width: 6, height: 79)", "cgRect", "(==)") } |
| 79 | +${ testCase("CGPoint", "CGPoint(x: 17, y: 38)", "cgPoint", "(==)") } |
| 80 | +${ testCase("CGSize", "CGSize(width: 6, height: 79)", "cgSize", "(==)") } |
| 81 | +${ testCase("CGVector", "CGVector(dx: 6, dy: 79)", "cgVector", "(==)") } |
| 82 | +${ testCase("CGAffineTransform", "CGAffineTransform(rotationAngle: .pi)", "cgAffineTransform", "(==)") } |
| 83 | + |
| 84 | +#endif |
| 85 | + |
69 | 86 | nsValueBridging.test("NSValue can only be cast back to its original type") {
|
70 | 87 | let range = NSRange(location: 17, length: 38)
|
71 | 88 | let rangeObject: Any = NSValue(range: range)
|
|
0 commit comments