mirror of
https://github.com/irmen/prog8.git
synced 2025-01-12 04:30:03 +00:00
string object identity hashcode can be negative sometimes, so allow a '-' character.
This commit is contained in:
parent
502bf90007
commit
e5b9e1f5e7
@ -219,7 +219,7 @@ class TestProg8Parser {
|
||||
val module = parseModule(SourceCode.Text(srcText))
|
||||
|
||||
// Note: assertContains has *actual* as first param
|
||||
assertContains(module.name, Regex("^<String@[0-9a-f]+>$"))
|
||||
assertContains(module.name, Regex("^<String@[0-9a-f\\-]+>$"))
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -289,7 +289,7 @@ class TestProg8Parser {
|
||||
try {
|
||||
parseModule(SourceCode.Text(srcText))
|
||||
} catch (e: ParseError) {
|
||||
assertPosition(e.position, Regex("^<String@[0-9a-f]+>$"), 1, 4, 4)
|
||||
assertPosition(e.position, Regex("^<String@[0-9a-f\\-]+>$"), 1, 4, 4)
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,7 +312,7 @@ class TestProg8Parser {
|
||||
}
|
||||
""".trimIndent()
|
||||
val module = parseModule(SourceCode.Text(srcText))
|
||||
assertPositionOf(module, Regex("^<String@[0-9a-f]+>$"), 1, 0) // TODO: endCol wrong
|
||||
assertPositionOf(module, Regex("^<String@[0-9a-f\\-]+>$"), 1, 0) // TODO: endCol wrong
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -22,7 +22,7 @@ class TestSourceCode {
|
||||
val src = SourceCode.Text(text)
|
||||
val actualText = src.getCharStream().toString()
|
||||
|
||||
assertContains(src.origin, Regex("^<String@[0-9a-f]+>$"))
|
||||
assertContains(src.origin, Regex("^<String@[0-9a-f\\-]+>$"))
|
||||
assertEquals(text, actualText)
|
||||
assertFalse(src.isFromResources)
|
||||
assertFalse(src.isFromFilesystem)
|
||||
|
Loading…
x
Reference in New Issue
Block a user