commit
5d4ac97678
@ -47,7 +47,7 @@ private extension SwiftGrammar {
|
|||||||
"super", "self", "set", "true", "false", "nil",
|
"super", "self", "set", "true", "false", "nil",
|
||||||
"override", "where", "_", "default", "break",
|
"override", "where", "_", "default", "break",
|
||||||
"#selector", "required", "willSet", "didSet",
|
"#selector", "required", "willSet", "didSet",
|
||||||
"lazy", "subscript", "defer"
|
"lazy", "subscript", "defer", "inout"
|
||||||
]
|
]
|
||||||
|
|
||||||
struct PreprocessingRule: SyntaxRule {
|
struct PreprocessingRule: SyntaxRule {
|
||||||
|
@ -494,6 +494,32 @@ 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),
|
||||||
|
.plainText(")"),
|
||||||
|
.whitespace(" "),
|
||||||
|
.plainText("{"),
|
||||||
|
.whitespace(" "),
|
||||||
|
.plainText("}")
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
func testAllTestsRunOnLinux() {
|
func testAllTestsRunOnLinux() {
|
||||||
XCTAssertTrue(TestCaseVerifier.verifyLinuxTests((type(of: self)).allTests))
|
XCTAssertTrue(TestCaseVerifier.verifyLinuxTests((type(of: self)).allTests))
|
||||||
}
|
}
|
||||||
@ -522,7 +548,8 @@ extension DeclarationTests {
|
|||||||
("testPropertyDeclarationWithWillSet", testPropertyDeclarationWithWillSet),
|
("testPropertyDeclarationWithWillSet", testPropertyDeclarationWithWillSet),
|
||||||
("testPropertyDeclarationWithDidSet", testPropertyDeclarationWithDidSet),
|
("testPropertyDeclarationWithDidSet", testPropertyDeclarationWithDidSet),
|
||||||
("testSubscriptDeclaration", testSubscriptDeclaration),
|
("testSubscriptDeclaration", testSubscriptDeclaration),
|
||||||
("testDeferDeclaration", testDeferDeclaration)
|
("testDeferDeclaration", testDeferDeclaration),
|
||||||
|
("testFunctionDeclarationWithInOutParameter", testFunctionDeclarationWithInOutParameter)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user