@@ -73,6 +73,21 @@ final class DeclarationTests: SyntaxHighlighterTestCase {
73
73
] )
74
74
}
75
75
76
+ func testFunctionDeclarationWithKeywordArgumentLabel( ) {
77
+ let components = highlighter. highlight ( " func a(for b: B) " )
78
+
79
+ XCTAssertEqual ( components, [
80
+ . token( " func " , . keyword) ,
81
+ . whitespace( " " ) ,
82
+ . plainText( " a(for " ) ,
83
+ . whitespace( " " ) ,
84
+ . plainText( " b: " ) ,
85
+ . whitespace( " " ) ,
86
+ . token( " B " , . type) ,
87
+ . plainText( " ) " )
88
+ ] )
89
+ }
90
+
76
91
func testGenericFunctionDeclarationWithoutConstraints( ) {
77
92
let components = highlighter. highlight ( " func hello<A, B>(a: A, b: B) " )
78
93
@@ -473,6 +488,7 @@ extension DeclarationTests {
473
488
( " testRequiredFunctionDeclaration " , testRequiredFunctionDeclaration) ,
474
489
( " testPublicFunctionDeclarationWithDocumentationEndingWithDot " , testPublicFunctionDeclarationWithDocumentationEndingWithDot) ,
475
490
( " testFunctionDeclarationWithEmptyExternalLabel " , testFunctionDeclarationWithEmptyExternalLabel) ,
491
+ ( " testFunctionDeclarationWithKeywordArgumentLabel " , testFunctionDeclarationWithKeywordArgumentLabel) ,
476
492
( " testGenericFunctionDeclarationWithoutConstraints " , testGenericFunctionDeclarationWithoutConstraints) ,
477
493
( " testGenericFunctionDeclarationWithSingleConstraint " , testGenericFunctionDeclarationWithSingleConstraint) ,
478
494
( " testGenericFunctionDeclarationWithMultipleConstraints " , testGenericFunctionDeclarationWithMultipleConstraints) ,
0 commit comments