mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Conditionalize tests to supported OSes only
This commit is contained in:
@@ -40,7 +40,7 @@ CastsTests.test("type(of:) should look through extended existentials (none)") {
|
||||
struct C<T>: Box { var t: T }
|
||||
func genericErase<T>(_ value: T) -> Any { value }
|
||||
let c: any Box<Int> = C(t: 42)
|
||||
if #available(macOS 13.0, *) {
|
||||
if #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) {
|
||||
let x = genericErase(c)
|
||||
expectEqual("C<Int>", "\(type(of:x))")
|
||||
} else {
|
||||
@@ -60,7 +60,7 @@ CastsTests.test("type(of:) should look through extended existentials (class)") {
|
||||
}
|
||||
func genericErase<T>(_ value: T) -> Any { value }
|
||||
let c: any OBox<Int> = C(t: 42)
|
||||
if #available(macOS 13.0, *) {
|
||||
if #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) {
|
||||
let x = genericErase(c)
|
||||
expectEqual("C<Int>", "\(type(of:x))")
|
||||
} else {
|
||||
@@ -73,7 +73,7 @@ CastsTests.test("type(of:) should look through extended existentials (metatype)"
|
||||
struct C<T>: Box { var t: T }
|
||||
func genericErase<T>(_ value: T) -> Any { value }
|
||||
let t: any Box<Int>.Type = C<Int>.self
|
||||
if #available(macOS 13.0, *) {
|
||||
if #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) {
|
||||
let x = genericErase(t)
|
||||
expectEqual("C<Int>.Type", "\(type(of:x))")
|
||||
} else {
|
||||
|
||||
@@ -934,7 +934,7 @@ mirrors.test("Extended Existential (struct)") {
|
||||
value
|
||||
}
|
||||
let container: any Box<Int> = Container(value: 42)
|
||||
if #available(macOS 13, *) {
|
||||
if #available(iOS 16, macOS 13, tvOS 16, watchOS 9, *) {
|
||||
let subject = genericErase(container)
|
||||
let mirror = Mirror(reflecting: subject)
|
||||
let children = mirror.children
|
||||
@@ -959,7 +959,7 @@ mirrors.test("Extended Existential (class)") {
|
||||
value
|
||||
}
|
||||
let container: any OBox<Int> = Container(value: 42)
|
||||
if #available(macOS 13, *) {
|
||||
if #available(iOS 16, macOS 13, tvOS 16, watchOS 9, *) {
|
||||
let subject = genericErase(container)
|
||||
let mirror = Mirror(reflecting: subject)
|
||||
let children = mirror.children
|
||||
@@ -979,7 +979,7 @@ mirrors.test("Extended Existential (metatype)") {
|
||||
value
|
||||
}
|
||||
let t: any Box<Int>.Type = Container<Int>.self
|
||||
if #available(macOS 13, *) {
|
||||
if #available(iOS 16, macOS 13, tvOS 16, watchOS 9, *) {
|
||||
let subject = genericErase(t)
|
||||
let mirror = Mirror(reflecting: subject)
|
||||
let children = mirror.children
|
||||
|
||||
Reference in New Issue
Block a user