@@ -196,6 +196,23 @@ final class FunctionCallTests: SyntaxHighlighterTestCase {
196196 ] )
197197 }
198198
199+ func testCallingMethodWithSameNameAsKeywordWithTrailingClosureSyntax( ) {
200+ let components = highlighter. highlight ( " publisher.catch { error in } " )
201+
202+ XCTAssertEqual ( components, [
203+ . plainText( " publisher. " ) ,
204+ . token( " catch " , . call) ,
205+ . whitespace( " " ) ,
206+ . plainText( " { " ) ,
207+ . whitespace( " " ) ,
208+ . plainText( " error " ) ,
209+ . whitespace( " " ) ,
210+ . token( " in " , . keyword) ,
211+ . whitespace( " " ) ,
212+ . plainText( " } " )
213+ ] )
214+ }
215+
199216 func testAllTestsRunOnLinux( ) {
200217 XCTAssertTrue ( TestCaseVerifier . verifyLinuxTests ( ( type ( of: self ) ) . allTests) )
201218 }
@@ -217,7 +234,8 @@ extension FunctionCallTests {
217234 ( " testIndentedFunctionCalls " , testIndentedFunctionCalls) ,
218235 ( " testXCTAssertCalls " , testXCTAssertCalls) ,
219236 ( " testUsingTryKeywordWithinFunctionCall " , testUsingTryKeywordWithinFunctionCall) ,
220- ( " testCallingFunctionWithProjectedPropertyWrapperValue " , testCallingFunctionWithProjectedPropertyWrapperValue)
237+ ( " testCallingFunctionWithProjectedPropertyWrapperValue " , testCallingFunctionWithProjectedPropertyWrapperValue) ,
238+ ( " testCallingMethodWithSameNameAsKeywordWithTrailingClosureSyntax " , testCallingMethodWithSameNameAsKeywordWithTrailingClosureSyntax)
221239 ]
222240 }
223241}
0 commit comments