- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathbasic.swift
15 lines (14 loc) · 694 Bytes
/
basic.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
func foo()->Int{
varaaa=1+2
aaa = aaa +3
if aaa ==3{ aaa =4}
return aaa
}
// RUN: %empty-directory(%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
// REQUIRES: swift_swift_parser