test added for the "inout" keyword

This commit is contained in:
Nikhil Muskur 2018-09-05 06:58:51 +05:30 committed by GitHub
parent b742c3cfa3
commit ea71fd7191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -494,6 +494,31 @@ final class DeclarationTests: SyntaxHighlighterTestCase {
])
}
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))
}