@@ -10,7 +10,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
10
10
private enum Foo {}
11
11
private protocol Foo {}
12
12
private typealias Foo = Bar
13
- private extension Foo {}
14
13
private func foo() {}
15
14
private var foo: Bar
16
15
""" ,
@@ -20,7 +19,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
20
19
fileprivate enum Foo {}
21
20
fileprivate protocol Foo {}
22
21
fileprivate typealias Foo = Bar
23
- fileprivate extension Foo {}
24
22
fileprivate func foo() {}
25
23
fileprivate var foo: Bar
26
24
""" )
@@ -31,7 +29,18 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
31
29
XCTAssertDiagnosed ( . replacePrivateWithFileprivate)
32
30
XCTAssertDiagnosed ( . replacePrivateWithFileprivate)
33
31
XCTAssertDiagnosed ( . replacePrivateWithFileprivate)
34
- XCTAssertDiagnosed ( . replacePrivateWithFileprivate)
32
+ }
33
+
34
+ func testFileScopeExtensionsAreNotChanged( ) {
35
+ XCTAssertFormatting (
36
+ FileprivateAtFileScope . self,
37
+ input: """
38
+ private extension Foo {}
39
+ """ ,
40
+ expected: """
41
+ private extension Foo {}
42
+ """ )
43
+ XCTAssertNotDiagnosed ( . replacePrivateWithFileprivate)
35
44
}
36
45
37
46
func testNonFileScopeDeclsAreNotChanged( ) {
@@ -70,7 +79,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
70
79
private enum Foo {}
71
80
private protocol Foo {}
72
81
private typealias Foo = Bar
73
- private extension Foo {}
74
82
private func foo() {}
75
83
private var foo: Bar
76
84
#elseif BAR
@@ -79,7 +87,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
79
87
private enum Foo {}
80
88
private protocol Foo {}
81
89
private typealias Foo = Bar
82
- private extension Foo {}
83
90
private func foo() {}
84
91
private var foo: Bar
85
92
#else
@@ -88,7 +95,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
88
95
private enum Foo {}
89
96
private protocol Foo {}
90
97
private typealias Foo = Bar
91
- private extension Foo {}
92
98
private func foo() {}
93
99
private var foo: Bar
94
100
#endif
@@ -100,7 +106,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
100
106
fileprivate enum Foo {}
101
107
fileprivate protocol Foo {}
102
108
fileprivate typealias Foo = Bar
103
- fileprivate extension Foo {}
104
109
fileprivate func foo() {}
105
110
fileprivate var foo: Bar
106
111
#elseif BAR
@@ -109,7 +114,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
109
114
fileprivate enum Foo {}
110
115
fileprivate protocol Foo {}
111
116
fileprivate typealias Foo = Bar
112
- fileprivate extension Foo {}
113
117
fileprivate func foo() {}
114
118
fileprivate var foo: Bar
115
119
#else
@@ -118,7 +122,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
118
122
fileprivate enum Foo {}
119
123
fileprivate protocol Foo {}
120
124
fileprivate typealias Foo = Bar
121
- fileprivate extension Foo {}
122
125
fileprivate func foo() {}
123
126
fileprivate var foo: Bar
124
127
#endif
@@ -136,7 +139,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
136
139
private enum Foo {}
137
140
private protocol Foo {}
138
141
private typealias Foo = Bar
139
- private extension Foo {}
140
142
private func foo() {}
141
143
private var foo: Bar
142
144
#endif
@@ -150,7 +152,6 @@ final class FileprivateAtFileScopeTests: LintOrFormatRuleTestCase {
150
152
fileprivate enum Foo {}
151
153
fileprivate protocol Foo {}
152
154
fileprivate typealias Foo = Bar
153
- fileprivate extension Foo {}
154
155
fileprivate func foo() {}
155
156
fileprivate var foo: Bar
156
157
#endif
0 commit comments