mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[test] Reinstate CoreGraphics↔︎NSValue bridging tests on iOS/watchOS/tvOS
This commit is contained in:
committed by
Károly Lőrentey
parent
79bdd43557
commit
73c99acf29
@@ -23,6 +23,10 @@ import StdlibUnittestFoundationExtras
|
||||
import Foundation
|
||||
import CoreGraphics
|
||||
|
||||
#if os(iOS) || os(tvOS) || os(watchOS)
|
||||
import UIKit
|
||||
#endif
|
||||
|
||||
var nsValueBridging = TestSuite("NSValueBridging")
|
||||
|
||||
func rangesEqual(_ x: NSRange, _ y: NSRange) -> Bool {
|
||||
@@ -66,6 +70,16 @@ ${ testCase("CGAffineTransform", "CGAffineTransform(rotationAngle: .pi)", N
|
||||
|
||||
#endif
|
||||
|
||||
#if os(iOS) || os(tvOS) || os(watchOS)
|
||||
|
||||
${ testCase("CGRect", "CGRect(x: 17, y: 38, width: 6, height: 79)", "cgRect", "(==)") }
|
||||
${ testCase("CGPoint", "CGPoint(x: 17, y: 38)", "cgPoint", "(==)") }
|
||||
${ testCase("CGSize", "CGSize(width: 6, height: 79)", "cgSize", "(==)") }
|
||||
${ testCase("CGVector", "CGVector(dx: 6, dy: 79)", "cgVector", "(==)") }
|
||||
${ testCase("CGAffineTransform", "CGAffineTransform(rotationAngle: .pi)", "cgAffineTransform", "(==)") }
|
||||
|
||||
#endif
|
||||
|
||||
nsValueBridging.test("NSValue can only be cast back to its original type") {
|
||||
let range = NSRange(location: 17, length: 38)
|
||||
let rangeObject: Any = NSValue(range: range)
|
||||
|
||||
Reference in New Issue
Block a user