Files
swift-mirror/test/SourceKit/CodeFormat/indent-with-tab.swift
Argyrios Kyrtzidis 7a982d6b8e [sourcekit] When printing requests/responses make sure to escape the strings.
This makes it more clear what the response string contains, plus you can copy the
printed request directly for passing to sourcekitd_request_create_from_yaml.
2016-01-22 13:29:32 -08:00

31 lines
1.2 KiB
Swift

class Foo {
var test : Int
func foo() {
test = 1
}
}
// RUN: %sourcekitd-test -req=format -line=1 -length=1 -req-opts=usetabs=1 %s >%t.response
// RUN: %sourcekitd-test -req=format -line=2 -length=1 -req-opts=usetabs=1 %s >>%t.response
// RUN: %sourcekitd-test -req=format -line=3 -length=1 -req-opts=usetabs=1 %s >>%t.response
// RUN: %sourcekitd-test -req=format -line=4 -length=1 -req-opts=usetabs=1 %s >>%t.response
// RUN: %sourcekitd-test -req=format -line=5 -length=1 -req-opts=usetabs=1 %s >>%t.response
// RUN: %sourcekitd-test -req=format -line=6 -length=1 -req-opts=usetabs=1 %s >>%t.response
// RUN: %sourcekitd-test -req=format -line=7 -length=1 -req-opts=usetabs=1 %s >>%t.response
// RUN: %sourcekitd-test -req=format -line=8 -length=1 -req-opts=usetabs=1 %s >>%t.response
// RUN: %sourcekitd-test -req=format -line=9 -length=1 -req-opts=usetabs=1 %s >>%t.response
// RUN: FileCheck --strict-whitespace %s <%t.response
// CHECK: key.sourcetext: "class Foo {"
// CHECK: key.sourcetext: "\t"
// CHECK: key.sourcetext: "\tvar test : Int"
// CHECK: key.sourcetext: "\t"
// CHECK: key.sourcetext: "\tfunc foo() {"
// CHECK: key.sourcetext: "\t\ttest = 1"
// CHECK: key.sourcetext: "\t}"
// CHECK: key.sourcetext: "\t"
// CHECK: key.sourcetext: "}"