Skip to content

Commit 54bc17e

Browse files
committed
[Gardening] Fix up order-dependent batch code complete tests
swift-ide-test -batch-code-completion has no particular order for the output completion list. Update the order dependent tests to use DAG instead.
1 parent a9f5107 commit 54bc17e

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

test/IDE/complete_expr_postfix_begin.swift

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -332,19 +332,23 @@ func foo() -> Undeclared {
332332
var fooParam = FooStruct()
333333
#^IN_INVALID_8?check=COMMON^#
334334
}
335-
// MY_ALIAS_1: Decl[TypeAlias]/Local: MyAlias[#(T, T)#];
336-
// MY_ALIAS_1: Decl[LocalVar]/Local/TypeRelation[Identical]: x[#MyAlias<Int>#]; name=x
337-
// MY_ALIAS_1: Decl[LocalVar]/Local/TypeRelation[Identical]: y[#(Int, Int)#]; name=y
335+
// MY_ALIAS_1: Begin completions
336+
// MY_ALIAS_1-DAG: Decl[TypeAlias]/Local: MyAlias[#(T, T)#];
337+
// MY_ALIAS_1-DAG: Decl[LocalVar]/Local/TypeRelation[Identical]: x[#MyAlias<Int>#]; name=x
338+
// MY_ALIAS_1-DAG: Decl[LocalVar]/Local/TypeRelation[Identical]: y[#(Int, Int)#]; name=y
339+
// MY_ALIAS_1: End completions
338340
339341
func testGenericTypealias1() {
340342
typealias MyAlias<T> = (T, T)
341343
let x: MyAlias<Int> = (1, 2)
342344
var y: (Int, Int)
343345
y = #^GENERIC_TYPEALIAS_1?check=MY_ALIAS_1^#
344346
}
345-
// MY_ALIAS_2: Decl[TypeAlias]/Local: MyAlias[#(T, T)#];
346-
// MY_ALIAS_2: Decl[LocalVar]/Local/TypeRelation[Identical]: x[#(Int, Int)#]; name=x
347-
// MY_ALIAS_2: Decl[LocalVar]/Local/TypeRelation[Identical]: y[#MyAlias<Int>#]; name=y
347+
// MY_ALIAS_2: Begin completions
348+
// MY_ALIAS_2-DAG: Decl[TypeAlias]/Local: MyAlias[#(T, T)#];
349+
// MY_ALIAS_2-DAG: Decl[LocalVar]/Local/TypeRelation[Identical]: x[#(Int, Int)#]; name=x
350+
// MY_ALIAS_2-DAG: Decl[LocalVar]/Local/TypeRelation[Identical]: y[#MyAlias<Int>#]; name=y
351+
// MY_ALIAS_2: End completions
348352
func testGenericTypealias2() {
349353
typealias MyAlias<T> = (T, T)
350354
let x: (Int, Int) = (1, 2)
@@ -468,13 +472,13 @@ func testTuple(localInt: Int) {
468472
let _: (Int, String) = (#^IN_TUPLE_2^#, "foo")
469473
}
470474
// IN_TUPLE_1: Begin completions
471-
// IN_TUPLE_1: Decl[LocalVar]/Local/TypeRelation[Identical]: localStr[#String#]; name=localStr
472-
// IN_TUPLE_1: Decl[LocalVar]/Local: localInt[#Int#]; name=localInt
475+
// IN_TUPLE_1-DAG: Decl[LocalVar]/Local/TypeRelation[Identical]: localStr[#String#]; name=localStr
476+
// IN_TUPLE_1-DAG: Decl[LocalVar]/Local: localInt[#Int#]; name=localInt
473477
// IN_TUPLE_1: End completions
474478
475479
// IN_TUPLE_2: Begin completions
476-
// IN_TUPLE_2: Decl[LocalVar]/Local: localStr[#String#]; name=localStr
477-
// IN_TUPLE_2: Decl[LocalVar]/Local/TypeRelation[Identical]: localInt[#Int#]; name=localInt
480+
// IN_TUPLE_2-DAG: Decl[LocalVar]/Local: localStr[#String#]; name=localStr
481+
// IN_TUPLE_2-DAG: Decl[LocalVar]/Local/TypeRelation[Identical]: localInt[#Int#]; name=localInt
478482
// IN_TUPLE_2: End completions
479483
480484
var ownInit1: Int = #^OWN_INIT_1^#
@@ -574,8 +578,7 @@ class InAccessorTestQualified {
574578
get {
575579
let _ = self.#^OWN_ACCESSOR_13^#
576580
// OWN_ACCESSOR_13: Begin completions
577-
// OWN_ACCESSOR_13-DAG: Decl[InstanceVar]/CurrNominal: inAccessorProp[#Int#];
578-
// OWN_ACCESSOR_13: End completions
581+
// OWN_ACCESSOR_13: Decl[InstanceVar]/CurrNominal: inAccessorProp[#Int#];
579582
let _ = \InAccessorTestQualified.#^OWN_ACCESSOR_14?check=OWN_ACCESSOR_13^#
580583
}
581584
set {

test/IDE/complete_multibracestmt.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func test(pred: Bool) {
3333
}
3434

3535
// CHECK: Begin completions, 3 items
36-
// CHECK: Decl[EnumElement]/ExprSpecific/TypeRelation[Identical]: bar[#E#]; name=bar
37-
// CHECK: Decl[EnumElement]/ExprSpecific/TypeRelation[Identical]: foo[#E#]; name=foo
38-
// CHECK: Decl[InstanceMethod]/CurrNominal/TypeRelation[Invalid]: hash({#(self): E#})[#(into: inout Hasher) -> Void#]; name=hash(self: E)
36+
// CHECK-DAG: Decl[EnumElement]/ExprSpecific/TypeRelation[Identical]: bar[#E#]; name=bar
37+
// CHECK-DAG: Decl[EnumElement]/ExprSpecific/TypeRelation[Identical]: foo[#E#]; name=foo
38+
// CHECK-DAG: Decl[InstanceMethod]/CurrNominal/TypeRelation[Invalid]: hash({#(self): E#})[#(into: inout Hasher) -> Void#]; name=hash(self: E)
3939
// CHECK: End completions

0 commit comments

Comments
 (0)