mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[test] Convert complete_return to batch-code-completion
This commit is contained in:
@@ -1,21 +1,4 @@
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_VOID_1 | %FileCheck %s -check-prefix=RETURN_VOID_1
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_INT_1 | %FileCheck %s -check-prefix=RETURN_INT_1
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_INT_2 | %FileCheck %s -check-prefix=RETURN_INT_2
|
||||
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TRY_RETURN_INT | %FileCheck %s -check-prefix=RETURN_INT_1
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TRY_RETURN_VOID | %FileCheck %s -check-prefix=RETURN_VOID_1
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR1 | %FileCheck %s -check-prefix=RETURN_TR1
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR2 | %FileCheck %s -check-prefix=RETURN_TR2
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR3 | %FileCheck %s -check-prefix=RETURN_TR3
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR1_METHOD | %FileCheck %s -check-prefix=RETURN_TR1
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR2_METHOD | %FileCheck %s -check-prefix=RETURN_TR2
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR3_METHOD | %FileCheck %s -check-prefix=RETURN_TR3
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR1_STATICMETHOD | %FileCheck %s -check-prefix=RETURN_TR1
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR2_STATICMETHOD | %FileCheck %s -check-prefix=RETURN_TR2
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR3_STATICMETHOD | %FileCheck %s -check-prefix=RETURN_TR3
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR1_CLOSURE | %FileCheck %s -check-prefix=RETURN_TR1
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR2_CLOSURE | %FileCheck %s -check-prefix=RETURN_TR2
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=RETURN_TR3_CLOSURE | %FileCheck %s -check-prefix=RETURN_TR3
|
||||
// RUN: %batch-code-completion
|
||||
|
||||
struct FooStruct {
|
||||
var instanceVar : Int
|
||||
@@ -64,11 +47,11 @@ func testReturnInt2(_ fooObject: FooStruct) {
|
||||
}
|
||||
|
||||
func testMisplacedTry() throws -> Int {
|
||||
try return #^TRY_RETURN_INT^#
|
||||
try return #^TRY_RETURN_INT?check=RETURN_INT_1^#
|
||||
}
|
||||
|
||||
func testMisplacedTryVoid() throws {
|
||||
try return #^TRY_RETURN_VOID^#
|
||||
try return #^TRY_RETURN_VOID?check=RETURN_VOID_1^#
|
||||
}
|
||||
|
||||
func testTR1() -> Int? {
|
||||
@@ -111,26 +94,26 @@ struct TestStruct {
|
||||
var i : Int
|
||||
var oi : Int?
|
||||
var fs : FooStruct
|
||||
return #^RETURN_TR1_METHOD^#
|
||||
return #^RETURN_TR1_METHOD?check=RETURN_TR1^#
|
||||
}
|
||||
func testTR2_method(_ g : Gen) -> Int? {
|
||||
return g.#^RETURN_TR2_METHOD^#
|
||||
return g.#^RETURN_TR2_METHOD?check=RETURN_TR2^#
|
||||
}
|
||||
func testTR3_method(_ g : Gen) -> Int? {
|
||||
return g.IG.#^RETURN_TR3_METHOD^#
|
||||
return g.IG.#^RETURN_TR3_METHOD?check=RETURN_TR3^#
|
||||
}
|
||||
|
||||
static func testTR1_static() -> Int? {
|
||||
var i : Int
|
||||
var oi : Int?
|
||||
var fs : FooStruct
|
||||
return #^RETURN_TR1_STATICMETHOD^#
|
||||
return #^RETURN_TR1_STATICMETHOD?check=RETURN_TR1^#
|
||||
}
|
||||
static func testTR2_static(_ g : Gen) -> Int? {
|
||||
return g.#^RETURN_TR2_STATICMETHOD^#
|
||||
return g.#^RETURN_TR2_STATICMETHOD?check=RETURN_TR2^#
|
||||
}
|
||||
static func testTR3_static(_ g : Gen) -> Int? {
|
||||
return g.IG.#^RETURN_TR3_STATICMETHOD^#
|
||||
return g.IG.#^RETURN_TR3_STATICMETHOD?check=RETURN_TR3^#
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,12 +123,12 @@ func testClosures(_ g: Gen) {
|
||||
var fs : FooStruct
|
||||
|
||||
_ = { () -> Int? in
|
||||
return #^RETURN_TR1_CLOSURE^#
|
||||
return #^RETURN_TR1_CLOSURE?check=RETURN_TR1^#
|
||||
}
|
||||
_ = { () -> Int? in
|
||||
return g.#^RETURN_TR2_CLOSURE^#
|
||||
return g.#^RETURN_TR2_CLOSURE?check=RETURN_TR2^#
|
||||
}
|
||||
_ = { () -> Int? in
|
||||
return g.IG.#^RETURN_TR3_CLOSURE^#
|
||||
return g.IG.#^RETURN_TR3_CLOSURE?check=RETURN_TR3^#
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user