Conditionalize tests to supported OSes only

This commit is contained in:
Tim Kientzle
2024-04-10 15:30:29 -07:00
parent 810792843b
commit 5251750999
2 changed files with 6 additions and 6 deletions

View File

@@ -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 {

View File

@@ -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