[
https://issues.apache.org/jira/browse/CALCITE-6172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17801276#comment-17801276
]
Julian Hyde commented on CALCITE-6172:
--------------------------------------
I don't feel strongly about either approach.
I do think that the commit - which will appear in the release notes - should
not be a proof-of-concept, it should fix the whole problem. It should have
subject "Allow aliased operators to re-use existing tests" and it should fix
the tests of all existing such operators.
An aliased operator should have at least one explicit test. For example {{LEN}}
is an alias for {{CHAR_LENGTH}}. There should be a test that "LEN('abc')" in
Snowflake library returns 3. Without that explicit test, there's a chance that
{{LEN}} will stop working and we will not notice.
My inclination would be for {{testLenFunction}} to be just two lines. It's very
low-tech but you can see exactly what is going on.
{code}
@Test void testLenFunction() {
sql("LEN('abc')").returns(3); // not the right syntax
checkCharLengthVariant("len");
}
{code}
> Allow aliased operators to re-use existing tests
> ------------------------------------------------
>
> Key: CALCITE-6172
> URL: https://issues.apache.org/jira/browse/CALCITE-6172
> Project: Calcite
> Issue Type: Improvement
> Reporter: Tanner Clary
> Assignee: Tanner Clary
> Priority: Major
> Labels: pull-request-available
>
> Currently, for operators that have multiple names (potentially across
> multiple libraries), there is no convenient way to re-use tests other than
> just copy and pasting. To avoid redundancy and potential discrepancies, it
> would be helpful if the same set of tests could be used for each alias.
> I'll modify this case once I have some ideas.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)