@@ -32,7 +32,7 @@ private func apply(edits: [TextEdit], to source: String) -> String {
32
32
return lineTable. content
33
33
}
34
34
35
- private func assertRename (
35
+ private func assertSingleFileRename (
36
36
_ markedSource: String ,
37
37
newName: String ,
38
38
expected: String ,
@@ -57,7 +57,7 @@ private func assertRename(
57
57
58
58
final class RenameTests : XCTestCase {
59
59
func testRenameVariableBaseName( ) async throws {
60
- try await assertRename (
60
+ try await assertSingleFileRename (
61
61
"""
62
62
let 1️⃣foo = 1
63
63
print(foo)
@@ -71,7 +71,7 @@ final class RenameTests: XCTestCase {
71
71
}
72
72
73
73
func testRenameFunctionBaseName( ) async throws {
74
- try await assertRename (
74
+ try await assertSingleFileRename (
75
75
"""
76
76
func 1️⃣foo() {}
77
77
foo()
@@ -85,7 +85,7 @@ final class RenameTests: XCTestCase {
85
85
}
86
86
87
87
func testRenameFunctionParameter( ) async throws {
88
- try await assertRename (
88
+ try await assertSingleFileRename (
89
89
"""
90
90
func 1️⃣foo(x: Int) {}
91
91
foo(x: 1)
@@ -99,7 +99,7 @@ final class RenameTests: XCTestCase {
99
99
}
100
100
101
101
func testSecondParameterNameIfMatches( ) async throws {
102
- try await assertRename (
102
+ try await assertSingleFileRename (
103
103
"""
104
104
func 1️⃣foo(x y: Int) {}
105
105
foo(x: 1)
@@ -113,7 +113,7 @@ final class RenameTests: XCTestCase {
113
113
}
114
114
115
115
func testIntroduceLabel( ) async throws {
116
- try await assertRename (
116
+ try await assertSingleFileRename (
117
117
"""
118
118
func 1️⃣foo(_ y: Int) {}
119
119
foo(1)
@@ -127,7 +127,7 @@ final class RenameTests: XCTestCase {
127
127
}
128
128
129
129
func testRemoveLabel( ) async throws {
130
- try await assertRename (
130
+ try await assertSingleFileRename (
131
131
"""
132
132
func 1️⃣foo(x: Int) {}
133
133
foo(x: 1)
@@ -141,7 +141,7 @@ final class RenameTests: XCTestCase {
141
141
}
142
142
143
143
func testRemoveLabelWithExistingInternalName( ) async throws {
144
- try await assertRename (
144
+ try await assertSingleFileRename (
145
145
"""
146
146
func 1️⃣foo(x a: Int) {}
147
147
foo(x: 1)
@@ -155,7 +155,7 @@ final class RenameTests: XCTestCase {
155
155
}
156
156
157
157
func testRenameSubscript( ) async throws {
158
- try await assertRename (
158
+ try await assertSingleFileRename (
159
159
"""
160
160
struct Foo {
161
161
1️⃣subscript(x x: Int) -> Int { x }
@@ -173,7 +173,7 @@ final class RenameTests: XCTestCase {
173
173
}
174
174
175
175
func testRemoveExternalLabelFromSubscript( ) async throws {
176
- try await assertRename (
176
+ try await assertSingleFileRename (
177
177
"""
178
178
struct Foo {
179
179
1️⃣subscript(x x: Int) -> Int { x }
@@ -191,7 +191,7 @@ final class RenameTests: XCTestCase {
191
191
}
192
192
193
193
func testIntroduceExternalLabelFromSubscript( ) async throws {
194
- try await assertRename (
194
+ try await assertSingleFileRename (
195
195
"""
196
196
struct Foo {
197
197
1️⃣subscript(x: Int) -> Int { x }
@@ -209,7 +209,7 @@ final class RenameTests: XCTestCase {
209
209
}
210
210
211
211
func testIgnoreRenameSubscriptBaseName( ) async throws {
212
- try await assertRename (
212
+ try await assertSingleFileRename (
213
213
"""
214
214
struct Foo {
215
215
1️⃣subscript(x: Int) -> Int { x }
@@ -227,7 +227,7 @@ final class RenameTests: XCTestCase {
227
227
}
228
228
229
229
func testRenameInitializerLabels( ) async throws {
230
- try await assertRename (
230
+ try await assertSingleFileRename (
231
231
"""
232
232
struct Foo {
233
233
1️⃣init(x: Int) {}
@@ -245,7 +245,7 @@ final class RenameTests: XCTestCase {
245
245
}
246
246
247
247
func testIgnoreRenameOfInitBaseName( ) async throws {
248
- try await assertRename (
248
+ try await assertSingleFileRename (
249
249
"""
250
250
struct Foo {
251
251
1️⃣init(x: Int) {}
@@ -263,7 +263,7 @@ final class RenameTests: XCTestCase {
263
263
}
264
264
265
265
func testRenameCompoundFunctionName( ) async throws {
266
- try await assertRename (
266
+ try await assertSingleFileRename (
267
267
"""
268
268
func 1️⃣foo(a: Int) {}
269
269
_ = foo(a:)
@@ -277,7 +277,7 @@ final class RenameTests: XCTestCase {
277
277
}
278
278
279
279
func testRemoveLabelFromCompoundFunctionName( ) async throws {
280
- try await assertRename (
280
+ try await assertSingleFileRename (
281
281
"""
282
282
func 1️⃣foo(a: Int) {}
283
283
_ = foo(a:)
@@ -291,7 +291,7 @@ final class RenameTests: XCTestCase {
291
291
}
292
292
293
293
func testIntroduceLabelToCompoundFunctionName( ) async throws {
294
- try await assertRename (
294
+ try await assertSingleFileRename (
295
295
"""
296
296
func 1️⃣foo(_ a: Int) {}
297
297
_ = foo(_:)
@@ -305,7 +305,7 @@ final class RenameTests: XCTestCase {
305
305
}
306
306
307
307
func testRenameFromReference( ) async throws {
308
- try await assertRename (
308
+ try await assertSingleFileRename (
309
309
"""
310
310
func foo(_ a: Int) {}
311
311
_ = 1️⃣foo(_:)
@@ -319,7 +319,7 @@ final class RenameTests: XCTestCase {
319
319
}
320
320
321
321
func testRenameMultipleParameters( ) async throws {
322
- try await assertRename (
322
+ try await assertSingleFileRename (
323
323
"""
324
324
func 1️⃣foo(a: Int, b: Int) {}
325
325
foo(a: 1, b: 1)
@@ -333,7 +333,7 @@ final class RenameTests: XCTestCase {
333
333
}
334
334
335
335
func testDontRenameParametersOmittedFromNewName( ) async throws {
336
- try await assertRename (
336
+ try await assertSingleFileRename (
337
337
"""
338
338
func 1️⃣foo(a: Int, b: Int) {}
339
339
foo(a: 1, b: 1)
@@ -347,7 +347,7 @@ final class RenameTests: XCTestCase {
347
347
}
348
348
349
349
func testIgnoreAdditionalParametersInNewName( ) async throws {
350
- try await assertRename (
350
+ try await assertSingleFileRename (
351
351
"""
352
352
func 1️⃣foo(a: Int) {}
353
353
foo(a: 1)
@@ -361,7 +361,7 @@ final class RenameTests: XCTestCase {
361
361
}
362
362
363
363
func testOnlySpecifyBaseNameWhenRenamingFunction( ) async throws {
364
- try await assertRename (
364
+ try await assertSingleFileRename (
365
365
"""
366
366
func 1️⃣foo(a: Int) {}
367
367
foo(a: 1)
@@ -375,7 +375,7 @@ final class RenameTests: XCTestCase {
375
375
}
376
376
377
377
func testIgnoreParametersInNewNameWhenRenamingVariable( ) async throws {
378
- try await assertRename (
378
+ try await assertSingleFileRename (
379
379
"""
380
380
let 1️⃣foo = 1
381
381
_ = foo
@@ -421,7 +421,7 @@ final class RenameTests: XCTestCase {
421
421
}
422
422
423
423
func testSpacesInNewParameterNames( ) async throws {
424
- try await assertRename (
424
+ try await assertSingleFileRename (
425
425
"""
426
426
func 1️⃣foo(a: Int) {}
427
427
foo(a: 1)
@@ -435,7 +435,7 @@ final class RenameTests: XCTestCase {
435
435
}
436
436
437
437
func testRenameOperator( ) async throws {
438
- try await assertRename (
438
+ try await assertSingleFileRename (
439
439
"""
440
440
struct Foo {}
441
441
func 1️⃣+(x: Foo, y: Foo) {}
@@ -451,7 +451,7 @@ final class RenameTests: XCTestCase {
451
451
}
452
452
453
453
func testRenameParameterToEmptyName( ) async throws {
454
- try await assertRename (
454
+ try await assertSingleFileRename (
455
455
"""
456
456
func 1️⃣foo(x: Int) {}
457
457
foo(x: 1)
@@ -468,7 +468,7 @@ final class RenameTests: XCTestCase {
468
468
#if !canImport(Darwin)
469
469
throw XCTSkip ( " #selector in test case doesn't compile without Objective-C runtime. " )
470
470
#endif
471
- try await assertRename (
471
+ try await assertSingleFileRename (
472
472
"""
473
473
import Foundation
474
474
class Foo: NSObject {
0 commit comments