Skip to content

Commit

Permalink
Made PR requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: MitchellGale-BitQuill <[email protected]>
  • Loading branch information
MitchellGale committed Oct 12, 2022
1 parent 4f321a1 commit 90f4358
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,11 @@ private static LocalTime getUtcTimeRefValue() {

private Temporal extractValue(FunctionExpression func) {
switch ((ExprCoreType)func.type()) {
case DATE:
return func.valueOf(null).dateValue();
case TIMESTAMP:
case DATETIME:
return func.valueOf(null).datetimeValue();
case TIME:
return func.valueOf(null).timeValue();
case DATE: return func.valueOf(null).dateValue();
case DATETIME: return func.valueOf(null).datetimeValue();
case TIME: return func.valueOf(null).timeValue();
// unreachable code
default:
throw new IllegalArgumentException(String.format("%s", func.type()));
default: throw new IllegalArgumentException(String.format("%s", func.type()));
}
}

Expand Down Expand Up @@ -139,7 +134,7 @@ public void test_now_like_functions(Function<Expression[], FunctionExpression> f

// Check how calculations are precise:
// `func()`
// 17:59:59.99999
// 17:59:59.99999 can pass as being equal to 18:00:00
var delta = resType == DATE ? 0 : 1;
assertTrue(Math.abs(getDiff(
extractValue(function.apply(new Expression[]{})),
Expand Down

0 comments on commit 90f4358

Please sign in to comment.