From ea71fd7191663b7c24fcc38cbe73844e7ff00fdb Mon Sep 17 00:00:00 2001 From: Nikhil Muskur Date: Wed, 5 Sep 2018 06:58:51 +0530 Subject: [PATCH] test added for the "inout" keyword --- .../SplashTests/Tests/DeclarationTests.swift | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Tests/SplashTests/Tests/DeclarationTests.swift b/Tests/SplashTests/Tests/DeclarationTests.swift index bf1c646..30a4fc8 100644 --- a/Tests/SplashTests/Tests/DeclarationTests.swift +++ b/Tests/SplashTests/Tests/DeclarationTests.swift @@ -493,6 +493,31 @@ final class DeclarationTests: SyntaxHighlighterTestCase { .plainText("}") ]) } + + func testFunctionDeclarationWithInOutParameter() { + let components = highlighter.highlight("func swapValues(value1: inout Int, value2: inout Int) { }") + + XCTAssertEqual(components, [ + .token("func", .keyword), + .whitespace(" "), + .plainText("swapValues(value1:"), + .whitespace(" "), + .token("inout", .keyword), + .whitespace(" "), + .token("Int", .type), + .plainText(","), + .whitespace(" "), + .plainText("value2:"), + .whitespace(" "), + .token("inout", .keyword), + .whitespace(" "), + .token("Int", .type), + .whitespace(" "), + .plainText("{"), + .whitespace(" "), + .plainText("}") + ]) + } func testAllTestsRunOnLinux() { XCTAssertTrue(TestCaseVerifier.verifyLinuxTests((type(of: self)).allTests))