mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
18 lines
422 B
Swift
18 lines
422 B
Swift
enum MyError : Error {
|
|
case customError
|
|
}
|
|
|
|
struct RefactorExtractProblem {
|
|
func testExtract() {
|
|
do {
|
|
throw MyError.customError
|
|
} catch {
|
|
print(error)
|
|
}
|
|
}
|
|
}
|
|
|
|
// RUN: rm -rf %t.result && mkdir -p %t.result
|
|
// RUN: %refactor -extract-function -source-filename %s -pos=7:1 -end-pos=11:6 >> %t.result/L7-11.swift
|
|
// RUN: diff -u %S/Outputs/throw_errors2/L7-11.swift.expected %t.result/L7-11.swift
|