Skip to content

Commit

Permalink
try to fix failed Windows UUID unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny-chung committed Apr 18, 2024
1 parent b420ccd commit 0f3de63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stdlib/src/commonTest/kotlin/UuidLibTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class UuidLibTest {
}
val interpreter = interpreter("""
val uuids = mutableSetOf<String>()
repeat(20000) {
repeat(20) {
uuids += uuid4().toString()
}
val n = uuids.size
val f = uuids.first()
""".trimIndent(), executionEnvironment = env)
interpreter.eval()
val symbolTable = interpreter.symbolTable()
assertEquals(20000, (symbolTable.findPropertyByDeclaredName("n") as IntValue).value)
assertEquals(20, (symbolTable.findPropertyByDeclaredName("n") as IntValue).value)
assertEquals(36, (symbolTable.findPropertyByDeclaredName("f") as StringValue).value.length)
assertTrue("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}".toRegex()
.matches((symbolTable.findPropertyByDeclaredName("f") as StringValue).value))
Expand All @@ -48,15 +48,15 @@ class UuidLibTest {
}
val interpreter = interpreter("""
val uuids = mutableSetOf<String>()
repeat(20000) {
repeat(20) {
uuids += uuidString()
}
val n = uuids.size
val f = uuids.first()
""".trimIndent(), executionEnvironment = env)
interpreter.eval()
val symbolTable = interpreter.symbolTable()
assertEquals(20000, (symbolTable.findPropertyByDeclaredName("n") as IntValue).value)
assertEquals(20, (symbolTable.findPropertyByDeclaredName("n") as IntValue).value)
assertEquals(36, (symbolTable.findPropertyByDeclaredName("f") as StringValue).value.length)
assertTrue("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}".toRegex()
.matches((symbolTable.findPropertyByDeclaredName("f") as StringValue).value))
Expand Down

0 comments on commit 0f3de63

Please sign in to comment.