Skip to content

Evolution tests: Don't bother testing changing a class's superclass #15000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions validation-test/Evolution/Inputs/superclass_methods.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ open class Base {
open class func classMethod() -> String {
return "Base.classMethod()"
}
}

open class OtherBase {
public init() {}
open func method() -> String {
return "OtherBase.method()"
}
open class func classMethod() -> String {
return "OtherBase.classMethod()"
open func nonOverriddenMethod() -> String {
return "Base.nonOverriddenMethod()"
}
}

Expand Down Expand Up @@ -66,9 +60,3 @@ open class InsertSuperclass : Base {}
#else
open class InsertSuperclass : InBetween {}
#endif

#if BEFORE
open class ChangeRoot : Base {}
#else
open class ChangeRoot : OtherBase {}
#endif
19 changes: 3 additions & 16 deletions validation-test/Evolution/Inputs/superclass_properties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@ open class Base {
open var property: String {
return "Base.property"
}
open class var classProperty: String {
return "Base.classProperty"
}
}

open class OtherBase {
public init() {}
open var property: String {
return "OtherBase.property"
open var nonOverriddenProperty: String {
return "Base.nonOverriddenProperty"
}
open class var classProperty: String {
return "OtherBase.classProperty"
return "Base.classProperty"
}
}

Expand Down Expand Up @@ -66,9 +59,3 @@ open class InsertSuperclass : Base {}
#else
open class InsertSuperclass : InBetween {}
#endif

#if BEFORE
open class ChangeRoot : Base {}
#else
open class ChangeRoot : OtherBase {}
#endif
22 changes: 2 additions & 20 deletions validation-test/Evolution/test_superclass_methods.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,15 @@ SuperclassMethodsTest.test("InsertSuperclass") {
}
if getVersion() == 0 {
expectEqual(Leaf().method(), "Base.method()")
expectEqual(Leaf().nonOverriddenMethod(), "Base.nonOverriddenMethod()")
expectEqual(Leaf.classMethod(), "Base.classMethod()")
} else {
expectEqual(Leaf().method(), "InBetween.method()")
expectEqual(Leaf().nonOverriddenMethod(), "Base.nonOverriddenMethod()")
expectEqual(Leaf.classMethod(), "InBetween.classMethod()")
}
}
}

SuperclassMethodsTest.test("ChangeRoot") {
do {
class Leaf : ChangeRoot {
override func method() -> String {
return super.method()
}
override class func classMethod() -> String {
return super.classMethod()
}
}
if getVersion() == 0 {
expectEqual(Leaf().method(), "Base.method()")
expectEqual(Leaf.classMethod(), "Base.classMethod()")
} else {
expectEqual(Leaf().method(), "OtherBase.method()")
expectEqual(Leaf.classMethod(), "OtherBase.classMethod()")
}
}
}

runAllTests()

22 changes: 2 additions & 20 deletions validation-test/Evolution/test_superclass_properties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,14 @@ SuperclassPropertiesTest.test("InsertSuperclass") {
}
if getVersion() == 0 {
expectEqual(Leaf().property, "Base.property")
expectEqual(Leaf().nonOverriddenProperty, "Base.nonOverriddenProperty")
expectEqual(Leaf.classProperty, "Base.classProperty")
} else {
expectEqual(Leaf().property, "InBetween.property")
expectEqual(Leaf().nonOverriddenProperty, "Base.nonOverriddenProperty")
expectEqual(Leaf.classProperty, "InBetween.classProperty")
}
}
}

SuperclassPropertiesTest.test("ChangeRoot") {
do {
class Leaf : ChangeRoot {
override var property: String {
return super.property
}
override class var classProperty: String {
return super.classProperty
}
}
if getVersion() == 0 {
expectEqual(Leaf().property, "Base.property")
expectEqual(Leaf.classProperty, "Base.classProperty")
} else {
expectEqual(Leaf().property, "OtherBase.property")
expectEqual(Leaf.classProperty, "OtherBase.classProperty")
}
}
}

runAllTests()