forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplete_sequence.swift
70 lines (61 loc) · 2.06 KB
/
complete_sequence.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class Foo {
var x: Int
var y: Int
func fooMethod() {}
}
struct Bar {
var a: Int
var b: Int
func barMethod() {}
}
func foo(arg: Foo) {
_ = arg.
}
func bar(arg: Bar) {
_ = arg.
}
// NOTE: Tests for 'key.codecomplete.reuseastcontex' option.
// Disabled.
// RUN: %sourcekitd-test \
// RUN: -req=global-config -req-opts=completion_max_astcontext_reuse_count=0 ==\
// RUN: -req=complete -pos=12:11 %s -- %s == \
// RUN: -req=complete -pos=15:11 %s -- %s > %t.response
// RUN: %FileCheck --check-prefix=RESULT_SLOW %s < %t.response
// Enabled.
// RUN: %sourcekitd-test \
// RUN: -req=complete -pos=12:11 %s -- %s == \
// RUN: -req=complete -pos=15:11 %s -- %s > %t.response.reuseastcontext
// RUN: %FileCheck --check-prefix=RESULT_FAST %s < %t.response.reuseastcontext
// Enabled - compiler argument mismatch.
// RUN: %sourcekitd-test \
// RUN: -req=complete -pos=12:11 %s -- %s -DNOTUSED == \
// RUN: -req=complete -pos=15:11 %s -- -DNOTUSED %s > %t.response.reuseastcontext_argmismatch
// RUN: %FileCheck --check-prefix=RESULT_SLOW %s < %t.response.reuseastcontext_argmismatch
// RESULT_SLOW-LABEL: key.results: [
// RESULT_SLOW-DAG: key.name: "fooMethod()"
// RESULT_SLOW-DAG: key.name: "self"
// RESULT_SLOW-DAG: key.name: "x"
// RESULT_SLOW-DAG: key.name: "y"
// RESULT_SLOW: ]
// RESULT_SLOW-NOT: key.reusingastcontext: 1
// RESULT_SLOW-LABEL: key.results: [
// RESULT_SLOW-DAG: key.name: "barMethod()"
// RESULT_SLOW-DAG: key.name: "self"
// RESULT_SLOW-DAG: key.name: "a"
// RESULT_SLOW-DAG: key.name: "b"
// RESULT_SLOW: ]
// RESULT_SLOW-NOT: key.reusingastcontext: 1
// RESULT_FAST-LABEL: key.results: [
// RESULT_FAST-DAG: key.name: "fooMethod()"
// RESULT_FAST-DAG: key.name: "self"
// RESULT_FAST-DAG: key.name: "x"
// RESULT_FAST-DAG: key.name: "y"
// RESULT_FAST: ]
// RESULT_FAST-NOT: key.reusingastcontext: 1
// RESULT_FAST-LABEL: key.results: [
// RESULT_FAST-DAG: key.name: "barMethod()"
// RESULT_FAST-DAG: key.name: "self"
// RESULT_FAST-DAG: key.name: "a"
// RESULT_FAST-DAG: key.name: "b"
// RESULT_FAST: ]
// RESULT_FAST: key.reusingastcontext: 1