[
https://issues.apache.org/jira/browse/CALCITE-5760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731130#comment-17731130
]
Jiajun Xie commented on CALCITE-5760:
-------------------------------------
We can execute by using `Fixtures.forOperators(true)`.
Here is
[demo|https://github.com/apache/calcite/blob/2e3e4ae220a69a0936792caec1fae23d947e77f3/testkit/src/test/java/org/apache/calcite/test/FixtureTest.java#L89].
> SqlOperatorTest::testDateTrunc does not validate results
> --------------------------------------------------------
>
> Key: CALCITE-5760
> URL: https://issues.apache.org/jira/browse/CALCITE-5760
> Project: Calcite
> Issue Type: Bug
> Components: tests
> Affects Versions: 1.34.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> I was trying to reproduce a bug where DATE_TRUNC returns an incorrect result
> when truncating a constant date to a MILLENNIUM.
> I found test cases for DATE_TRUNC in SqlOperatorTest; these test cases do
> specify the expected result, e.g.:
> f.checkScalar("date_trunc(date '2015-02-19', isoyear)",
> "2014-12-29", "DATE NOT NULL");
> However, the test fixture uses AbstractSqlTester::check, which ignores the
> result!
> As a proof, one can replace the results with arbitrary strings and the tests
> will still pass.
> I presume that this is not the intent of the test writers. How could this
> test be fixed to also check the results?
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)