Files
swift-mirror/test/IDE/complete_concurrency_keyword.swift
Daniel Rodríguez Troitiño 748339a83a [test] Mark concurrency tests with appropiate REQUIRES. (#35624)
The Python build system always enables concurrency, but CMake has it
disable by default. Collaborators that do not use the Python build
system and use directly CMake will have it disable, unless they
explicitely enable it. If the tests are not marked as requiring the
concurrency features, the tests will fail to execute when concurrency is
disabled.

The changes add the `REQUIRES: concurrency` line to many tests that deal
with concurrency, but wasn't marked as such.
2021-02-01 11:45:15 -08:00

49 lines
1.3 KiB
Swift

// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t -enable-experimental-concurrency
// REQUIRES: concurrency
// CHECK_DECL: NOT
#^GLOBAL^#
// GLOBAL: Begin completions
// GLOBAL-DAG: Keyword/None: actor; name=actor
// GLOBAL-DAG: Keyword/None: await; name=await
// GLOBAL: End completion
enum Namespace {
#^TYPEMEMBER^#
// TYPEMEMBER: Begin completions
// TYPEMEMBER-NOT: await
// TYPEMEMBER-DAG: Keyword/None: actor; name=actor
// TYPEMEMBER-NOT: await
// TYPEMEMBER: End completion
}
func testFunc() {
#^STMT^#
// STMT: Begin completions
// STMT-DAG: Keyword/None: actor; name=actor
// STMT-DAG: Keyword/None: await; name=await
// STMT: End completion
}
func testExpr() {
_ = #^EXPR^#
// EXPR: Begin completions
// EXPR-NOT: actor
// EXPR-DAG: Keyword/None: await; name=await
// EXPR-NOT: actor
// EXPR: End completion
}
func testClosure() {
func receiveClosure(_: () async -> Void) {}
receiveClosure { #^IN_CLOSURE?check=STMT^# }
}
func testFunc(x: Int = #^FUNCDEFAULTPARAM?check=EXPR^#) {}
struct Something {
var x = #^MEMBERINIT?check=EXPR^#
func testFunc(x: Int = #^METHODDEFAULTPARAM?check=EXPR^#) {}
}