@Test
public void date() {

  when(nullRef.type()).thenReturn(DATE);
  when(missingRef.type()).thenReturn(DATE);
  assertEquals(nullValue(), eval(dsl.date(nullRef)));
  assertEquals(missingValue(), eval(dsl.date(missingRef)));
  FunctionExpression expr = dsl.date(DSL.literal("2020-08-17"));
  assertEquals(DATE, expr.type());
  assertEquals(new ExprDateValue("2020-08-17"), eval(expr));
  assertEquals("date(\"2020-08-17\")", expr.toString());
  expr = dsl.date(DSL.literal(new ExprDateValue("2020-08-17")));
  assertEquals(DATE, expr.type());
  assertEquals(new ExprDateValue("2020-08-17"), eval(expr));
  assertEquals("date(DATE '2020-08-17')", expr.toString());
}