mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[refactoring] Upstreaming the implementation for Swift local refactoring (#11568)
[refactoring] Upstreaming the implementation for Swift local refactoring
This commit is contained in:
committed by
GitHub
parent
9edef031e4
commit
60a91bb736
14
test/refactoring/ExtractFunction/basic.swift
Normal file
14
test/refactoring/ExtractFunction/basic.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
func foo() -> Int{
|
||||
var aaa = 1 + 2
|
||||
aaa = aaa + 3
|
||||
if aaa == 3 { aaa = 4 }
|
||||
return aaa
|
||||
}
|
||||
|
||||
// RUN: rm -rf %t.result && mkdir -p %t.result
|
||||
// RUN: %refactor -extract-function -source-filename %s -pos=2:1 -end-pos=5:13 >> %t.result/L2-5.swift
|
||||
// RUN: diff -u %S/Outputs/basic/L2-5.swift.expected %t.result/L2-5.swift
|
||||
// RUN: %refactor -extract-function -source-filename %s -pos=3:1 -end-pos=5:13 >> %t.result/L3-5.swift
|
||||
// RUN: diff -u %S/Outputs/basic/L3-5.swift.expected %t.result/L3-5.swift
|
||||
// RUN: %refactor -extract-function -source-filename %s -pos=3:1 -end-pos=4:26 >> %t.result/L3-4.swift
|
||||
// RUN: diff -u %S/Outputs/basic/L3-4.swift.expected %t.result/L3-4.swift
|
||||
Reference in New Issue
Block a user