Skip to content

Commit

Permalink
Merge pull request #26885 from lorentey/nein-nein-nein-nein
Browse files Browse the repository at this point in the history
[test] Denineninenineninify behavioral tests added for 5.1
  • Loading branch information
lorentey authored Aug 28, 2019
2 parents 3321794 + b90e2ef commit 8fcc94f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public struct Pair : P {
}
#endif

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public func resilientFunction() -> some P {
#if BEFORE
return Int(5)
Expand All @@ -28,12 +28,12 @@ public func resilientFunction() -> some P {
#endif
}

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public func expectedResult() -> Int {
return resilientFunction().getValue()
}

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public func expectedSize() -> Int {
return MemoryLayout.size(ofValue: resilientFunction())
}
Expand All @@ -42,7 +42,7 @@ public func expectedSize() -> Int {
public struct Container {
public init() {}

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public var property : some P {
get {
#if BEFORE
Expand All @@ -53,12 +53,12 @@ public struct Container {
}
}

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public func expectedResult() -> Int {
return property.getValue()
}

@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public func expectedSize() -> Int {
return MemoryLayout.size(ofValue: property)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import StdlibUnittest
var OpaqueArchetypes = TestSuite("OpaqueArchetypes")

OpaqueArchetypes.test("test1") {
if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) {
if #available(macOS 15.0, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
let o = resilientFunction()
expectEqual(o.getValue(), expectedResult())
expectEqual(MemoryLayout.size(ofValue: o), expectedSize())
Expand Down
2 changes: 1 addition & 1 deletion validation-test/Reflection/existentials_objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Foundation

import SwiftReflectionTest

if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
// Imported class wrapped in AnyObject

// CHECK: Type reference:
Expand Down
4 changes: 2 additions & 2 deletions validation-test/stdlib/Dictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3000,7 +3000,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.RemoveAll") {
}

DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.RemoveAll") {
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
if #available(macOS 15.0, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
// Identity of empty dictionaries changed in
// https://github.com/apple/swift/pull/22527
var d = getBridgedNonverbatimDictionary([:])
Expand Down Expand Up @@ -3295,7 +3295,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.EqualityTest_Empty") {
}

DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.EqualityTest_Empty") {
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else {
guard #available(macOS 15.0, iOS 13.0, watchOS 6.0, tvOS 13.0, *) else {
// Identity of empty dictionaries changed in
// https://github.com/apple/swift/pull/22527
return
Expand Down
14 changes: 7 additions & 7 deletions validation-test/stdlib/Set.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ SetTestSuite.test("BridgedFromObjC.Verbatim.RemoveAll") {
}

SetTestSuite.test("BridgedFromObjC.Nonverbatim.RemoveAll") {
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
if #available(macOS 15.0, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
// Identity of empty sets changed in https://github.com/apple/swift/pull/22527
var s = getBridgedNonverbatimSet([])
expectTrue(isNativeSet(s))
Expand Down Expand Up @@ -2168,7 +2168,7 @@ SetTestSuite.test("BridgedFromObjC.Verbatim.EqualityTest_Empty") {
}

SetTestSuite.test("BridgedFromObjC.Nonverbatim.EqualityTest_Empty") {
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else {
guard #available(macOS 15.0, iOS 13.0, watchOS 6.0, tvOS 13.0, *) else {
// Identity of empty sets changed in https://github.com/apple/swift/pull/22527
return
}
Expand Down Expand Up @@ -4667,7 +4667,7 @@ SetTestSuite.test("IndexValidation.RemoveAt.AfterGrow") {
}

#if _runtime(_ObjC)
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
// https://github.com/apple/swift/pull/23174
SetTestSuite.test("ForcedNonverbatimBridge.Trap.String")
.skip(.custom(
Expand All @@ -4690,7 +4690,7 @@ if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
#endif

#if _runtime(_ObjC)
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
// https://github.com/apple/swift/pull/23174
SetTestSuite.test("ForcedNonverbatimBridge.Trap.Int")
.skip(.custom(
Expand Down Expand Up @@ -4822,7 +4822,7 @@ SetTestSuite.test("ForcedVerbatimDowncast.Trap.Int")
#endif

#if _runtime(_ObjC)
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
// https://github.com/apple/swift/pull/23174
SetTestSuite.test("ForcedBridgingNonverbatimDowncast.Trap.String")
.skip(.custom(
Expand All @@ -4846,7 +4846,7 @@ if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
#endif

#if _runtime(_ObjC)
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
// https://github.com/apple/swift/pull/23174
SetTestSuite.test("ForcedBridgingNonverbatimDowncast.Trap.Int")
.skip(.custom(
Expand All @@ -4871,7 +4871,7 @@ if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
#endif

#if _runtime(_ObjC)
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
// https://github.com/apple/swift/pull/23683
SetTestSuite.test("Upcast.StringEqualityMismatch") {
// Upcasting from NSString to String keys changes their concept of equality,
Expand Down

0 comments on commit 8fcc94f

Please sign in to comment.