Skip to content

Commit 3850417

Browse files
author
Nathan Hawes
committed
[Test][CodeCompletion] Consistently check for the 'unknown' type relation when there's no expected type.
The tests were matching the previous implementation's output, which sometimes produced 'unknown' and sometimes 'unrelated' in cases where there was no expected type from the context.
1 parent 5625751 commit 3850417

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

test/SourceKit/CodeComplete/complete_annotateddescription.swift.result

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
key.description: "<name>init</name>()",
9595
key.typename: "<typeid.user>MyStruct</typeid.user>",
9696
key.context: source.codecompletion.context.thisclass,
97-
key.typerelation: source.codecompletion.typerelation.unrelated,
97+
key.typerelation: source.codecompletion.typerelation.unknown,
9898
key.num_bytes_to_erase: 0,
9999
key.associated_usrs: "s:29complete_annotateddescription8MyStructVACycfc",
100100
key.modulename: "complete_annotateddescription"
@@ -106,7 +106,7 @@
106106
key.description: "<name>labelName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
107107
key.typename: "(label: (<attribute>@autoclosure</attribute> () -&gt; <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
108108
key.context: source.codecompletion.context.thisclass,
109-
key.typerelation: source.codecompletion.typerelation.unrelated,
109+
key.typerelation: source.codecompletion.typerelation.unknown,
110110
key.num_bytes_to_erase: 0,
111111
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9labelName0E0yS2iyXKXE_tF",
112112
key.modulename: "complete_annotateddescription"
@@ -118,7 +118,7 @@
118118
key.description: "<name>labelNameParamName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
119119
key.typename: "(label: (<keyword>inout</keyword> <typeid.sys>Int</typeid.sys>) <keyword>throws</keyword> -&gt; <typeid.user>MyStruct</typeid.user>) -&gt; <typeid.sys>Void</typeid.sys>",
120120
key.context: source.codecompletion.context.thisclass,
121-
key.typerelation: source.codecompletion.typerelation.unrelated,
121+
key.typerelation: source.codecompletion.typerelation.unknown,
122122
key.num_bytes_to_erase: 0,
123123
key.associated_usrs: "s:29complete_annotateddescription8MyStructV014labelNameParamF00E0yACSizKXE_tKF",
124124
key.modulename: "complete_annotateddescription"
@@ -130,7 +130,7 @@
130130
key.description: "<name>paramName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
131131
key.typename: "(<typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
132132
key.context: source.codecompletion.context.thisclass,
133-
key.typerelation: source.codecompletion.typerelation.unrelated,
133+
key.typerelation: source.codecompletion.typerelation.unknown,
134134
key.num_bytes_to_erase: 0,
135135
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9paramNameyySiF",
136136
key.modulename: "complete_annotateddescription"
@@ -142,7 +142,7 @@
142142
key.description: "<name>sameName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
143143
key.typename: "(label: <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
144144
key.context: source.codecompletion.context.thisclass,
145-
key.typerelation: source.codecompletion.typerelation.unrelated,
145+
key.typerelation: source.codecompletion.typerelation.unknown,
146146
key.num_bytes_to_erase: 0,
147147
key.associated_usrs: "s:29complete_annotateddescription8MyStructV8sameName5labelySi_tF",
148148
key.modulename: "complete_annotateddescription"

test/SourceKit/CodeComplete/complete_docbrief_1.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func test() {
3535
// CHECK-NEXT: key.typename: "Void",
3636
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.bar",
3737
// CHECK-NEXT: key.context: source.codecompletion.context.superclass,
38-
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unrelated,
38+
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
3939
// CHECK-NEXT: key.num_bytes_to_erase: 0,
4040
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1PPAAE3baryyF",
4141
// CHECK-NEXT: key.modulename: "DocBriefTest"
@@ -48,7 +48,7 @@ func test() {
4848
// CHECK-NEXT: key.typename: "Void",
4949
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
5050
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
51-
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unrelated,
51+
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
5252
// CHECK-NEXT: key.num_bytes_to_erase: 0,
5353
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
5454
// CHECK-NEXT: key.modulename: "DocBriefTest"

test/SourceKit/CodeComplete/complete_docbrief_2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func test() {
3939
// CHECK-NEXT: key.typename: "Void",
4040
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
4141
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
42-
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unrelated,
42+
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
4343
// CHECK-NEXT: key.num_bytes_to_erase: 0,
4444
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefUser1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
4545
// CHECK-NEXT: key.modulename: "DocBriefUser"

test/SourceKit/CodeComplete/complete_docbrief_3.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func test() {
4040
// CHECK-NEXT: key.typename: "Void",
4141
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
4242
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
43-
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unrelated,
43+
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
4444
// CHECK-NEXT: key.num_bytes_to_erase: 0,
4545
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
4646
// CHECK-NEXT: key.modulename: "DocBriefTest"

test/SourceKit/CodeComplete/complete_member.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func testOverrideUSR() {
5151
// CHECK-OPTIONAL-NEXT: key.description: "fooInstanceFunc1(a: Int)",
5252
// CHECK-OPTIONAL-NEXT: key.typename: "Double",
5353
// CHECK-OPTIONAL-NEXT: key.context: source.codecompletion.context.thisclass,
54-
// CHECK-OPTIONAL-NEXT: key.typerelation: source.codecompletion.typerelation.unrelated,
54+
// CHECK-OPTIONAL-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
5555
// CHECK-OPTIONAL-NEXT: key.num_bytes_to_erase: 1,
5656
// CHECK-OPTIONAL-NEXT: key.associated_usrs: "s:15complete_member11FooProtocolP16fooInstanceFunc1ySdSiF",
5757
// CHECK-OPTIONAL-NEXT: key.modulename: "complete_member"
@@ -73,7 +73,7 @@ func testOverrideUSR() {
7373
// CHECK-OVERRIDE_USR-NEXT: key.description: "foo()",
7474
// CHECK-OVERRIDE_USR-NEXT: key.typename: "Void",
7575
// CHECK-OVERRIDE_USR-NEXT: key.context: source.codecompletion.context.thisclass,
76-
// CHECK-OVERRIDE_USR-NEXT: key.typerelation: source.codecompletion.typerelation.unrelated,
76+
// CHECK-OVERRIDE_USR-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
7777
// CHECK-OVERRIDE_USR-NEXT: key.num_bytes_to_erase: 0,
7878
// CHECK-OVERRIDE_USR-NEXT: key.associated_usrs: "s:15complete_member7DerivedC3fooyyF s:15complete_member4BaseC3fooyyF",
7979
// CHECK-OVERRIDE_USR-NEXT: key.modulename: "complete_member"

test/SourceKit/CodeComplete/complete_member.swift.response

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
key.description: "fooInstanceFunc0()",
88
key.typename: "Double",
99
key.context: source.codecompletion.context.thisclass,
10-
key.typerelation: source.codecompletion.typerelation.unrelated,
10+
key.typerelation: source.codecompletion.typerelation.unknown,
1111
key.num_bytes_to_erase: 0,
1212
key.associated_usrs: "s:15complete_member11FooProtocolP16fooInstanceFunc0SdyF",
1313
key.modulename: "complete_member"
@@ -19,7 +19,7 @@
1919
key.description: "fooInstanceFunc1(a: Int)",
2020
key.typename: "Double",
2121
key.context: source.codecompletion.context.thisclass,
22-
key.typerelation: source.codecompletion.typerelation.unrelated,
22+
key.typerelation: source.codecompletion.typerelation.unknown,
2323
key.num_bytes_to_erase: 0,
2424
key.associated_usrs: "s:15complete_member11FooProtocolP16fooInstanceFunc1ySdSiF",
2525
key.modulename: "complete_member"
@@ -32,7 +32,7 @@
3232
key.typename: "Int",
3333
key.doc.brief: "fooInstanceVar Aaa. Bbb.",
3434
key.context: source.codecompletion.context.thisclass,
35-
key.typerelation: source.codecompletion.typerelation.unrelated,
35+
key.typerelation: source.codecompletion.typerelation.unknown,
3636
key.num_bytes_to_erase: 0,
3737
key.associated_usrs: "s:15complete_member11FooProtocolP14fooInstanceVarSivp",
3838
key.modulename: "complete_member"

0 commit comments

Comments
 (0)