Files
swift-mirror/test/refactoring/ExtractFunction/static.swift
Argyrios Kyrtzidis 60a91bb736 [refactoring] Upstreaming the implementation for Swift local refactoring (#11568)
[refactoring] Upstreaming the implementation for Swift local refactoring
2017-08-22 16:50:16 -07:00

20 lines
564 B
Swift

class C {
func foo1() -> Int {
var a = 3 + 1
a = 3
return a
}
static func foo2() -> Int {
var a = 3 + 1
a = 3
return a
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %refactor -extract-function -source-filename %s -pos=3:1 -end-pos=5:13 >> %t.result/L3-5.swift
// RUN: diff -u %S/Outputs/static/L3-5.swift.expected %t.result/L3-5.swift
// RUN: %refactor -extract-function -source-filename %s -pos=9:1 -end-pos=11:13 >> %t.result/L9-11.swift
// RUN: diff -u %S/Outputs/static/L9-11.swift.expected %t.result/L9-11.swift