Merge branch 'master' into patch-1
This commit is contained in:
commit
2a049c2031
@ -47,8 +47,8 @@ private extension SwiftGrammar {
|
||||
"super", "self", "set", "true", "false", "nil",
|
||||
"override", "where", "_", "default", "break",
|
||||
"#selector", "required", "willSet", "didSet",
|
||||
"lazy", "subscript", "defer", "continue",
|
||||
"fallthrough", "repeat", "while"
|
||||
"lazy", "subscript", "defer", "inout", "while"
|
||||
"continue", "fallthrough", "repeat"
|
||||
]
|
||||
|
||||
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() {
|
||||
XCTAssertTrue(TestCaseVerifier.verifyLinuxTests((type(of: self)).allTests))
|
||||
}
|
||||
@ -522,7 +548,8 @@ extension DeclarationTests {
|
||||
("testPropertyDeclarationWithWillSet", testPropertyDeclarationWithWillSet),
|
||||
("testPropertyDeclarationWithDidSet", testPropertyDeclarationWithDidSet),
|
||||
("testSubscriptDeclaration", testSubscriptDeclaration),
|
||||
("testDeferDeclaration", testDeferDeclaration)
|
||||
("testDeferDeclaration", testDeferDeclaration),
|
||||
("testFunctionDeclarationWithInOutParameter", testFunctionDeclarationWithInOutParameter)
|
||||
]
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user