Files
swift-mirror/validation-test/Evolution/test_struct_resilient_remove_conformance.swift
Arnold Schwaighofer 127b2ab939 Remove the remaining swift_test_mode_optimize_none_with_implicit_dynamic
It is expected that under enable-private-import internal/private symbols
become public. So that symbol-diffing would fail. Disable symbol diffing
under that test mode.

rdar://51304243
2019-06-12 15:54:49 -07:00

58 lines
1.0 KiB
Swift

// RUN: %target-resilience-test
// REQUIRES: executable_test
import StdlibUnittest
import struct_resilient_remove_conformance
var StructResilientRemoveConformanceTest = TestSuite("StructResilientRemoveConformance")
StructResilientRemoveConformanceTest.test("RemoveConformance") {
var t = RemoveConformance()
do {
t.x = 10
t.y = 20
expectEqual(t.x, 10)
expectEqual(t.y, 20)
}
}
#if AFTER
protocol MyPointLike {
var x: Int { get set }
var y: Int { get set }
}
protocol MyPoint3DLike {
var z: Int { get set }
}
extension RemoveConformance : MyPointLike {}
extension RemoveConformance : MyPoint3DLike {}
@inline(never) func workWithMyPointLike<T>(_ t: T) {
var p = t as! MyPointLike
p.x = 50
p.y = 60
expectEqual(p.x, 50)
expectEqual(p.y, 60)
}
StructResilientRemoveConformanceTest.test("MyPointLike") {
var p: MyPointLike = RemoveConformance()
do {
p.x = 50
p.y = 60
expectEqual(p.x, 50)
expectEqual(p.y, 60)
}
workWithMyPointLike(p)
}
#endif
runAllTests()