Files
swift-mirror/test/SourceKit/CodeFormat/indent-with-tab.swift
Xi Ge b17ccf1ae7 Formatting: when aligning siblings in indentation, we should respect use tab setting. rdar://32611247 (#11334)
We use white spaces for the remaining that cannot be filled with tabs.
2017-08-04 12:14:23 -07:00

36 lines
1.4 KiB
Swift

class Foo {
var test : Int
func foo() {
test = 1
}
}
func bar(a: Int,
b: Int) {}
// 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: %sourcekitd-test -req=format -line=12 -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: "}"
// CHECK: key.sourcetext: "\t\t b: Int) {}"