Files
swift-mirror/test/refactoring/ExtractFunction/extract_with_comments.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

17 lines
416 B
Swift

public class C {
public func foo() -> Int{
var aaa = 1 + 2
// this is comments
aaa = aaa + 3
if aaa == 3 { aaa = 4 }
// we have comments here too
return aaa
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %refactor -extract-function -source-filename %s -pos=6:1 -end-pos=7:26 >> %t.result/L6-7.swift
// RUN: diff -u %S/Outputs/extract_with_comments/L6-7.swift.expected %t.result/L6-7.swift