Skip to content

Commit 6ad5e8b

Browse files
committed
[SourceKit][Test] Add a test to ensure function arguments' labels are aligned properly. rdar://26069993
1 parent 0793258 commit 6ad5e8b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/SourceKit/CodeFormat/indent-sibling2.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ static func _consoleConnected(type: CGSNotificationType,
3737
_ cid: CGSConnectionID) {
3838
}
3939

40+
public func someTestFunc(withArgumentLabel label: String,
41+
someOtherArgumentLabel label2: String,
42+
andAnotherArgumentLabel label3: String) {
43+
}
44+
4045
// RUN: %sourcekitd-test -req=format -line=6 -length=1 %s >%t.response
4146
// RUN: %sourcekitd-test -req=format -line=7 -length=1 %s >>%t.response
4247
// RUN: %sourcekitd-test -req=format -line=8 -length=1 %s >>%t.response
@@ -49,6 +54,8 @@ static func _consoleConnected(type: CGSNotificationType,
4954
// RUN: %sourcekitd-test -req=format -line=35 -length=1 %s >>%t.response
5055
// RUN: %sourcekitd-test -req=format -line=36 -length=1 %s >>%t.response
5156
// RUN: %sourcekitd-test -req=format -line=37 -length=1 %s >>%t.response
57+
// RUN: %sourcekitd-test -req=format -line=41 -length=1 %s >>%t.response
58+
// RUN: %sourcekitd-test -req=format -line=42 -length=1 %s >>%t.response
5259

5360
// RUN: FileCheck --strict-whitespace %s <%t.response
5461

@@ -80,3 +87,9 @@ static func _consoleConnected(type: CGSNotificationType,
8087

8188
// " _ arg: CGSNotificationArg,"
8289
// CHECK: key.sourcetext: " _ cid: CGSConnectionID) {"
90+
91+
// "public func someTestFunc(withArgumentLabel label: String,"
92+
// CHECK: key.sourcetext: " someOtherArgumentLabel label2: String,"
93+
94+
// " someOtherArgumentLabel label2: String,"
95+
// CHECK: key.sourcetext: " andAnotherArgumentLabel label3: String) {"

0 commit comments

Comments
 (0)