chunweilei commented on code in PR #2772:
URL: https://github.com/apache/calcite/pull/2772#discussion_r855714341
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -845,15 +845,15 @@ protected SqlOperatorFixture fixture() {
final SqlOperatorFixture f = fixture();
f.setFor(SqlStdOperatorTable.CAST, VmName.EXPAND);
- f.checkScalarExact("cast( cast(1.25 as double) as integer)", 1);
- f.checkScalarExact("cast( cast(-1.25 as double) as integer)", -1);
+ f.checkFails("cast( cast(1.25 as double) as integer)", "Value out of
range.", true);
+ f.checkFails("cast( cast(-1.25 as double) as integer)", "Value out of
range.", true);
if (!f.brokenTestsEnabled()) {
return;
}
- f.checkScalarExact("cast( cast(1.75 as double) as integer)", 2);
- f.checkScalarExact("cast( cast(-1.75 as double) as integer)", -2);
- f.checkScalarExact("cast( cast(1.5 as double) as integer)", 2);
- f.checkScalarExact("cast( cast(-1.5 as double) as integer)", -2);
+ f.checkFails("cast( cast(1.75 as double) as integer)", "Value out of
range.", true);
+ f.checkFails("cast( cast(-1.75 as double) as integer)", "Value out of
range.", true);
+ f.checkFails("cast( cast(1.5 as double) as integer)", "Value out of
range.", true);
Review Comment:
Besides, we could use OUT_OF_RANGE_MESSAGE instead of "Value out of range."
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]