Skip to content

Commit 667ab8a

Browse files
committed
un-ignore precedence testing for double division
1 parent fd13996 commit 667ab8a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test/scala/test/integration/PrecedenceTests.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import tyql.Dialect.ansi.given
1111
class PrecedenceTests extends FunSuite {
1212
def expectB(expected: Boolean)(rs: ResultSet) = assertEquals(rs.getBoolean(1), expected)
1313
def expectI(expected: Int)(rs: ResultSet) = assertEquals(rs.getInt(1), expected)
14+
def expectD(expected: Double)(rs: ResultSet) = assertEquals(rs.getDouble(1), expected)
1415

1516
val t = tyql.True
1617
val f = tyql.False
@@ -71,11 +72,10 @@ class PrecedenceTests extends FunSuite {
7172
checkExprDialect[Boolean](t ^ t || f, expectB(false))(withDB.all)
7273
}
7374

74-
test("integer precedence -- division and subtraction".ignore) {
75-
// TODO we currently do not handle / as it's very dialect specific and not yet implemented
76-
// checkExprDialect[Int](i3 / i1 - i2, expectI(2))(withDB.all)
77-
// checkExprDialect[Int](i3 - i1 / i2, expectI(2))(withDB.all)
78-
// checkExprDialect[Int](i3 / (i1 - i2), expectI(-3))(withDB.all)
75+
test("integer precedence -- division and subtraction") {
76+
checkExprDialect[Double](i3 / i1 - i2.asDouble, expectD(1.0))(withDB.all)
77+
checkExprDialect[Double](i3.asDouble - i1 / i2, expectD(2.5))(withDB.all)
78+
checkExprDialect[Double](i3 / (i1 - i2), expectD(-3.0))(withDB.all)
7979
}
8080

8181
test("mixed precedence -- arithmetic with boolean") {

0 commit comments

Comments
 (0)