forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_nowait.swift
42 lines (36 loc) · 1.88 KB
/
edit_nowait.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
// REQUIRES: rdar88504525
// RUN: %empty-directory(%t)
// RUN: echo "func f() { f() }" > %t/t.swift
// RUN: %sourcekitd-test \
// RUN: -req=open -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift -print-raw-response -- %t/t.swift == \
// RUN: -req=edit -offset=0 -replace="func foo() { warn("") }" -length=16 -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift -print-raw-response == \
// RUN: -req=edit -offset=13 -replace="print" -length=5 -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift -print-raw-response \
// RUN: | %FileCheck --check-prefix=EDIT_NOWAIT %s
// EDIT_NOWAIT: {
// EDIT_NOWAIT-NEXT: }
// EDIT_NOWAIT-NEXT: {
// EDIT_NOWAIT-NEXT: }
// EDIT_NOWAIT-NEXT: {
// EDIT_NOWAIT-NEXT: }
// RUN: %sourcekitd-test \
// RUN: -req=open -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift -- %t/t.swift == \
// RUN: -req=print-annotations %t/t.swift == \
// RUN: -req=edit -offset=0 -replace="func foo() { warn("") }" -length=16 -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift == \
// RUN: -req=edit -offset=13 -replace="print" -length=4 -req-opts=enablesyntaxmap=0,enablesubstructure=0,enablediagnostics=0 %t/t.swift == \
// RUN: -req=print-annotations %t/t.swift \
// RUN: | %FileCheck --check-prefix=ANNOTATION %s
// ANNOTATION-LABEL: [
// ANNOTATION-NEXT: {
// ANNOTATION-NEXT: key.kind: source.lang.swift.ref.function.free,
// ANNOTATION-NEXT: key.offset: 11,
// ANNOTATION-NEXT: key.length: 1
// ANNOTATION-NEXT: }
// ANNOTATION-NEXT: ]
// ANNOTATION-LABEL: [
// ANNOTATION-NEXT: {
// ANNOTATION-NEXT: key.kind: source.lang.swift.ref.function.free,
// ANNOTATION-NEXT: key.offset: 13,
// ANNOTATION-NEXT: key.length: 5,
// ANNOTATION-NEXT: key.is_system: 1
// ANNOTATION-NEXT: }
// ANNOTATION-NEXT: ]