File tree Expand file tree Collapse file tree 4 files changed +9
-70
lines changed
validation-test/Evolution Expand file tree Collapse file tree 4 files changed +9
-70
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,9 @@ open class Base {
14
14
open class func classMethod( ) -> String {
15
15
return " Base.classMethod() "
16
16
}
17
- }
18
17
19
- open class OtherBase {
20
- public init ( ) { }
21
- open func method( ) -> String {
22
- return " OtherBase.method() "
23
- }
24
- open class func classMethod( ) -> String {
25
- return " OtherBase.classMethod() "
18
+ open func nonOverriddenMethod( ) -> String {
19
+ return " Base.nonOverriddenMethod() "
26
20
}
27
21
}
28
22
@@ -66,9 +60,3 @@ open class InsertSuperclass : Base {}
66
60
#else
67
61
open class InsertSuperclass : InBetween { }
68
62
#endif
69
-
70
- #if BEFORE
71
- open class ChangeRoot : Base { }
72
- #else
73
- open class ChangeRoot : OtherBase { }
74
- #endif
Original file line number Diff line number Diff line change @@ -11,18 +11,11 @@ open class Base {
11
11
open var property : String {
12
12
return " Base.property "
13
13
}
14
- open class var classProperty : String {
15
- return " Base.classProperty "
16
- }
17
- }
18
-
19
- open class OtherBase {
20
- public init ( ) { }
21
- open var property : String {
22
- return " OtherBase.property "
14
+ open var nonOverriddenProperty : String {
15
+ return " Base.nonOverriddenProperty "
23
16
}
24
17
open class var classProperty : String {
25
- return " OtherBase .classProperty"
18
+ return " Base .classProperty"
26
19
}
27
20
}
28
21
@@ -66,9 +59,3 @@ open class InsertSuperclass : Base {}
66
59
#else
67
60
open class InsertSuperclass : InBetween { }
68
61
#endif
69
-
70
- #if BEFORE
71
- open class ChangeRoot : Base { }
72
- #else
73
- open class ChangeRoot : OtherBase { }
74
- #endif
Original file line number Diff line number Diff line change @@ -59,33 +59,15 @@ SuperclassMethodsTest.test("InsertSuperclass") {
59
59
}
60
60
if getVersion ( ) == 0 {
61
61
expectEqual ( Leaf ( ) . method ( ) , " Base.method() " )
62
+ expectEqual ( Leaf ( ) . nonOverriddenMethod ( ) , " Base.nonOverriddenMethod() " )
62
63
expectEqual ( Leaf . classMethod ( ) , " Base.classMethod() " )
63
64
} else {
64
65
expectEqual ( Leaf ( ) . method ( ) , " InBetween.method() " )
66
+ expectEqual ( Leaf ( ) . nonOverriddenMethod ( ) , " Base.nonOverriddenMethod() " )
65
67
expectEqual ( Leaf . classMethod ( ) , " InBetween.classMethod() " )
66
68
}
67
69
}
68
70
}
69
71
70
- SuperclassMethodsTest . test ( " ChangeRoot " ) {
71
- do {
72
- class Leaf : ChangeRoot {
73
- override func method( ) -> String {
74
- return super. method ( )
75
- }
76
- override class func classMethod( ) -> String {
77
- return super. classMethod ( )
78
- }
79
- }
80
- if getVersion ( ) == 0 {
81
- expectEqual ( Leaf ( ) . method ( ) , " Base.method() " )
82
- expectEqual ( Leaf . classMethod ( ) , " Base.classMethod() " )
83
- } else {
84
- expectEqual ( Leaf ( ) . method ( ) , " OtherBase.method() " )
85
- expectEqual ( Leaf . classMethod ( ) , " OtherBase.classMethod() " )
86
- }
87
- }
88
- }
89
-
90
72
runAllTests ( )
91
73
Original file line number Diff line number Diff line change @@ -59,32 +59,14 @@ SuperclassPropertiesTest.test("InsertSuperclass") {
59
59
}
60
60
if getVersion ( ) == 0 {
61
61
expectEqual ( Leaf ( ) . property, " Base.property " )
62
+ expectEqual ( Leaf ( ) . nonOverriddenProperty, " Base.nonOverriddenProperty " )
62
63
expectEqual ( Leaf . classProperty, " Base.classProperty " )
63
64
} else {
64
65
expectEqual ( Leaf ( ) . property, " InBetween.property " )
66
+ expectEqual ( Leaf ( ) . nonOverriddenProperty, " Base.nonOverriddenProperty " )
65
67
expectEqual ( Leaf . classProperty, " InBetween.classProperty " )
66
68
}
67
69
}
68
70
}
69
71
70
- SuperclassPropertiesTest . test ( " ChangeRoot " ) {
71
- do {
72
- class Leaf : ChangeRoot {
73
- override var property : String {
74
- return super. property
75
- }
76
- override class var classProperty : String {
77
- return super. classProperty
78
- }
79
- }
80
- if getVersion ( ) == 0 {
81
- expectEqual ( Leaf ( ) . property, " Base.property " )
82
- expectEqual ( Leaf . classProperty, " Base.classProperty " )
83
- } else {
84
- expectEqual ( Leaf ( ) . property, " OtherBase.property " )
85
- expectEqual ( Leaf . classProperty, " OtherBase.classProperty " )
86
- }
87
- }
88
- }
89
-
90
72
runAllTests ( )
You can’t perform that action at this time.
0 commit comments