Skip to content

Commit 131d36d

Browse files
committed
updated SourceKit tests
1 parent 7b41a41 commit 131d36d

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

test/SourceKit/CodeComplete/complete_filter.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func foo() {
7070
// CHECK-NEXT: abc()
7171
// CHECK-NEXT: b()
7272
// CHECK-NEXT: c()
73+
// CHECK-NEXT: self
7374
// CHECK-NEXT: ]
7475
// CHECK-LABEL: Results for filterText: a [
7576
// CHECK-NEXT: aaa()

test/SourceKit/CodeComplete/complete_group_overloads.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ func test005() {
8585
}
8686
// Inline a lonely group
8787
// RUN: %complete-test -group=overloads -add-inner-results -no-inner-operators -tok=BAR_INIT_0 %s | %FileCheck -check-prefix=BAR_INIT_0 %s
88-
// BAR_INIT_0-NOT: (:
88+
// BAR_INIT_0-LABEL: (:
8989
// BAR_INIT_0: ()
9090
// BAR_INIT_0-NEXT: (x: A)
9191
// BAR_INIT_0-NEXT: (x: B)
92+
// BAR_INIT_0-NEXT: .self
9293

9394
extension Bar {
9495
func foo()

test/SourceKit/CodeComplete/complete_inner.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ func test001() {
5959

6060
// TOP_LEVEL_0-LABEL: Results for filterText: foo [
6161
// TOP_LEVEL_0-NEXT: Foo
62+
// TOP_LEVEL_0-NEXT: Foo.
6263
// TOP_LEVEL_0-NEXT: Foo(
6364
// TOP_LEVEL_0-NEXT: FooBar
65+
// TOP_LEVEL_0-NEXT: Foo.self
6466
// TOP_LEVEL_0-NEXT: Foo()
6567
// TOP_LEVEL_0-NEXT: ]
6668

@@ -72,6 +74,7 @@ func test001() {
7274
// TOP_LEVEL_0-NEXT: FooBar
7375
// TOP_LEVEL_0-NEXT: FooBar.
7476
// TOP_LEVEL_0-NEXT: FooBar(
77+
// TOP_LEVEL_0-NEXT: FooBar.self
7578
// TOP_LEVEL_0-NEXT: FooBar()
7679
// TOP_LEVEL_0-NEXT: FooBar(x: Foo)
7780
// TOP_LEVEL_0-NEXT: FooBar.fooBar()
@@ -92,6 +95,7 @@ func test002(abc: FooBar, abd: Base) {
9295
// TOP_LEVEL_1-NEXT: abc.
9396
// TOP_LEVEL_1-NEXT: abc===
9497
// TOP_LEVEL_1-NEXT: abc!==
98+
// TOP_LEVEL_1-NEXT: abc.self
9599
// TOP_LEVEL_1-NEXT: abc.method()
96100
// TOP_LEVEL_1-NEXT: abc.prop
97101
// TOP_LEVEL_1-NEXT: ]
@@ -101,6 +105,7 @@ func test002(abc: FooBar, abd: Base) {
101105
// TOP_LEVEL_1-NEXT: abd.
102106
// TOP_LEVEL_1-NEXT: abd===
103107
// TOP_LEVEL_1-NEXT: abd!==
108+
// TOP_LEVEL_1-NEXT: abd.self
104109
// TOP_LEVEL_1-NEXT: abd.base()
105110
// TOP_LEVEL_1-NEXT: ]
106111

@@ -138,12 +143,14 @@ func test003(x: FooBar) {
138143
// FOOBAR_QUALIFIED_NOOP-NEXT: ]
139144
// FOOBAR_QUALIFIED_NOOP-LABEL: Results for filterText: prop [
140145
// FOOBAR_QUALIFIED_NOOP-NEXT: prop
146+
// FOOBAR_QUALIFIED_NOOP-NEXT: prop.self
141147
// FOOBAR_QUALIFIED_NOOP-NEXT: prop.method()
142148
// FOOBAR_QUALIFIED_NOOP-NEXT: prop.prop
143149
// FOOBAR_QUALIFIED_NOOP-NEXT: ]
144150

145151
// RUN: %complete-test %s -group=none -no-include-exact-match -add-inner-results -no-inner-operators -tok=FOOBAR_QUALIFIED | %FileCheck %s -check-prefix=FOOBAR_QUALIFIED_NOEXACT
146152
// FOOBAR_QUALIFIED_NOEXACT-LABEL: Results for filterText: prop [
153+
// FOOBAR_QUALIFIED_NOEXACT-NEXT: prop.self
147154
// FOOBAR_QUALIFIED_NOEXACT-NEXT: prop.method()
148155
// FOOBAR_QUALIFIED_NOEXACT-NEXT: prop.prop
149156
// FOOBAR_QUALIFIED_NOEXACT-NEXT: ]

test/SourceKit/CodeComplete/complete_member.swift.response

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@
3333
key.num_bytes_to_erase: 0,
3434
key.associated_usrs: "s:15complete_member11FooProtocolP14fooInstanceVarSivp",
3535
key.modulename: "complete_member"
36+
},
37+
{
38+
key.kind: source.lang.swift.keyword,
39+
key.name: "self",
40+
key.sourcetext: "self",
41+
key.description: "self",
42+
key.typename: "FooProtocol",
43+
key.context: source.codecompletion.context.thisclass,
44+
key.num_bytes_to_erase: 0
3645
}
3746
]
3847
}

test/SourceKit/CodeComplete/complete_requestlimit.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func test002(x: B) {
6363
// B_INSTANCE_0_ALL: a
6464
// B_INSTANCE_0_ALL-NEXT: b
6565
// B_INSTANCE_0_ALL-NEXT: c
66+
// B_INSTANCE_0_ALL-NEXT: self
6667

6768
// B_INSTANCE_0_1: a
6869
// B_INSTANCE_0_1-NOT: b
@@ -107,6 +108,7 @@ func test003(x: D) {
107108
// OVERLOADS_ALL-NEXT: aaa(x: A)
108109
// OVERLOADS_ALL-NEXT: aaa(x: B)
109110
// OVERLOADS_ALL-NEXT: aab()
111+
// OVERLOADS_ALL-NEXT: self
110112

111113
// limit applies to top-level, not to subgroups
112114
// OVERLOADS_1: aaa:
@@ -121,11 +123,11 @@ func test003(x: D) {
121123
// If we return all the results, nextrequeststart == 0
122124
// RUN: %complete-test -group=overloads -tok=D_INSTANCE_0 %s -raw | %FileCheck -check-prefix=NEXT-END %s
123125
// RUN: %complete-test -group=overloads -tok=D_INSTANCE_0 %s -raw -limit=5 | %FileCheck -check-prefix=NEXT-END %s
124-
// RUN: %complete-test -group=overloads -tok=D_INSTANCE_0 %s -raw -limit=2 | %FileCheck -check-prefix=NEXT-END %s
126+
// RUN: %complete-test -group=overloads -tok=D_INSTANCE_0 %s -raw -limit=3 | %FileCheck -check-prefix=NEXT-END %s
125127
// NEXT-END: key.nextrequeststart: 0
126128

127129
// If we return the last result, nextrequeststart == 0
128-
// RUN: %complete-test -group=overloads -tok=D_INSTANCE_0 %s -raw -start=1 -limit=1 | %FileCheck -check-prefix=NEXT-END %s
130+
// RUN: %complete-test -group=overloads -tok=D_INSTANCE_0 %s -raw -start=2 -limit=1 | %FileCheck -check-prefix=NEXT-END %s
129131

130132
// Otherwise, it's the next result
131133
// RUN: %complete-test -group=overloads -tok=D_INSTANCE_0 %s -raw -limit=1 | %FileCheck -check-prefix=NEXT1 %s

0 commit comments

Comments
 (0)