Skip to content

Commit 311bbf8

Browse files
authored
Do not use soft constraints in Division::testUnknownDivision (#306)
With default options, this test sometimes is very long. Without soft constraints, the test becomes fast
1 parent 4c0d9fb commit 311bbf8

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

  • usvm-ts/src/test/kotlin/org/usvm/samples/operators

usvm-ts/src/test/kotlin/org/usvm/samples/operators/Division.kt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@ class Division : TsMethodTestRunner() {
5252
@Test
5353
fun testUnknownDivision() {
5454
val method = getMethod(className, "unknownDivision")
55-
discoverProperties<TsTestValue, TsTestValue, TsTestValue.TsNumber>(
56-
method = method,
57-
{ a, b, r -> (a is TsTestValue.TsUndefined || b is TsTestValue.TsUndefined) && r.number.isNaN() },
58-
{ _, _, r -> r.number == 4.0 },
59-
{ _, _, r -> r.number == Double.POSITIVE_INFINITY },
60-
{ _, _, r -> r.number == Double.NEGATIVE_INFINITY },
61-
{ _, _, r -> r.number.isNaN() },
62-
)
55+
withOptions(options.copy(useSoftConstraints = false)) {
56+
discoverProperties<TsTestValue, TsTestValue, TsTestValue.TsNumber>(
57+
method = method,
58+
{ a, b, r -> (a is TsTestValue.TsUndefined || b is TsTestValue.TsUndefined) && r.number.isNaN() },
59+
{ _, _, r -> r.number == 4.0 },
60+
{ _, _, r -> r.number == Double.POSITIVE_INFINITY },
61+
{ _, _, r -> r.number == Double.NEGATIVE_INFINITY },
62+
{ _, _, r -> r.number.isNaN() },
63+
)
64+
}
6365
}
64-
}
66+
}

0 commit comments

Comments
 (0)