Added unittest with surogate character

This commit is contained in:
Cyril Lashkevich
2018-03-11 12:43:38 +01:00
parent fd7c463c85
commit 9983be7cfe
2 changed files with 12 additions and 1 deletions
+2 -1
View File
@@ -205,7 +205,8 @@ extension IdentifierNameRuleTests {
("testIdentifierName", testIdentifierName),
("testIdentifierNameWithAllowedSymbols", testIdentifierNameWithAllowedSymbols),
("testIdentifierNameWithAllowedSymbolsAndViolation", testIdentifierNameWithAllowedSymbolsAndViolation),
("testIdentifierNameWithIgnoreStartWithLowercase", testIdentifierNameWithIgnoreStartWithLowercase)
("testIdentifierNameWithIgnoreStartWithLowercase", testIdentifierNameWithIgnoreStartWithLowercase),
("testLinuxCrashOnEmojiNames", testLinuxCrashOnEmojiNames)
]
}
@@ -53,4 +53,14 @@ class IdentifierNameRuleTests: XCTestCase {
verifyRule(description, ruleConfiguration: ["validates_start_with_lowercase": false])
}
func testLinuxCrashOnEmojiNames() {
let baseDescription = IdentifierNameRule.description
let triggeringExamples = [
"let 👦🏼 = \"👦🏼\""
]
let description = baseDescription.with(triggeringExamples: triggeringExamples)
verifyRule(description, ruleConfiguration: ["allowed_symbols": ["$", "%"]])
}
}