mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Some of the tests now depend on features provided by Swift Syntax, and will fail to pass if building without Swift Syntax support. This commits marks all the tests I know fail to pass when Swift Syntax is disabled. - #70281 modified `ASTGen/verify-parse.swift` - #70287 created `refactoring/SyntacticRename/operator.swift` and `SourceKit/RelatedIdents/operator.swift` - #70389 modified `SourceKit/Refactoring/basic.swift` and indirectly modified all `refactoring/ExtractFunction/*` tests.
21 lines
861 B
Swift
21 lines
861 B
Swift
enum Err : Error {
|
|
case wat
|
|
}
|
|
|
|
func throwsSomething() throws { throw Err.wat }
|
|
func consumesErrClosure(_ fn: () throws -> Void) {}
|
|
func rethrowsErrClosure(_ fn: () throws -> Void) rethrows {}
|
|
|
|
func testThrowingClosure() throws {
|
|
consumesErrClosure { throw Err.wat }
|
|
consumesErrClosure { try throwsSomething() }
|
|
try rethrowsErrClosure { try throwsSomething() }
|
|
}
|
|
|
|
// RUN: %empty-directory(%t.result)
|
|
// RUN: %refactor -extract-function -source-filename %s -pos=10:1 -end-pos=11:47 >> %t.result/consumes_err.swift
|
|
// RUN: diff -u %S/Outputs/throw_errors3/consumes_err.swift.expected %t.result/consumes_err.swift
|
|
// RUN: %refactor -extract-function -source-filename %s -pos=10:1 -end-pos=12:51 >> %t.result/rethrows_err.swift
|
|
// RUN: diff -u %S/Outputs/throw_errors3/rethrows_err.swift.expected %t.result/rethrows_err.swift
|
|
// REQUIRES: swift_swift_parser
|