mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Added unittest with surogate character
This commit is contained in:
@@ -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": ["$", "%"]])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user