Skip to content

Commit 8630e72

Browse files
committed
🐛 Fix: Rename test functions with JS-incompatible characters
Test function names with backticks containing special characters (like patterns with = or unicode) generate JavaScript identifiers that fail to compile. Renamed to simple camelCase names.
1 parent cb5cd81 commit 8630e72

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

common/src/commonTest/kotlin/com/qrshield/security/InputValidatorTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class InputValidatorTest {
136136
// === SQL INJECTION PATTERN DETECTION ===
137137

138138
@Test
139-
fun `detects OR 1=1 SQL injection`() {
139+
fun `detects OR equals SQL injection`() {
140140
assertTrue(InputValidator.containsSqlInjectionPatterns("' OR 1=1 --"))
141141
}
142142

@@ -180,22 +180,22 @@ class InputValidatorTest {
180180
}
181181

182182
@Test
183-
fun `punycode hostname passes validation`() {
183+
fun testPunycodeHostnamePassesValidation() {
184184
val result = InputValidator.validateHostname("xn--nxasmq5b.com")
185185
assertTrue(result.isValid())
186186
}
187187

188188
// === EDGE CASES ===
189189

190190
@Test
191-
fun `URL with spaces in path is sanitized`() {
191+
fun testUrlWithSpacesInPathIsSanitized() {
192192
val result = InputValidator.validateUrl("https://example.com/path with spaces")
193193
assertTrue(result.isValid())
194194
assertTrue(result.getOrNull()?.contains("%20") == true)
195195
}
196196

197197
@Test
198-
fun `URL is trimmed`() {
198+
fun testUrlIsTrimmed() {
199199
val result = InputValidator.validateUrl(" https://example.com ")
200200
assertTrue(result.isValid())
201201
assertEquals("https://example.com", result.getOrNull())

0 commit comments

Comments
 (0)