Files
swift-mirror/validation-test/IDE/issues_fixed/rdar64227741.swift
Alex Hoppen 32eff21977 [IDE] Remove "Begin completions" and "End completions" from test cases
These test lines weren't actually providing any value and were annoying to write. Let's jut remove them.
2023-03-22 09:07:17 -07:00

38 lines
1.0 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
struct Earthquake {
var magnitude: Float
}
@resultBuilder
struct TestBuilder<Q> {
static func buildBlock(_ exp: String) -> String { "test" }
static func buildExpression<T>(_ sample: KeyPath<Q, T>) -> String { "test" }
static func buildExpression(_ func: (Q) -> Bool) -> String { "test" }
}
func ==<V, T: Equatable> (left: KeyPath<V, T>, right: T) -> (V) -> Bool {
return { $0[keyPath: left] == right }
}
func ||<T> (left: @escaping (T) -> Bool, right: @escaping (T) -> Bool) -> (T) -> Bool {
return { left($0) || right($0) }
}
class Test<Q> {
init(@TestBuilder<Q> _ builder: () -> String) {}
}
func test() {
_ = Test<Earthquake> {
\.magnitude == 2 || \.#^COMPLETE_1?check=CHECK^#
}
_ = Test<Earthquake> {
\.magnitude == 2 || \.#^COMPLETE_2?check=CHECK^# == 3
}
}
// CHECK: Begin completions, 1 items
// CHECK: Decl[InstanceVar]/CurrNominal: magnitude[#Float#]; name=magnitude