cqframework / cqframework/cql-tests

Incorrectly Translated Test Case for IncludedIn Causes Incorrect Results

Open
#64 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CQLTest: CQL-test-code CQLTest: Translator Issue
Dominant language
No language data
Stars
7
Forks
8
Avg merge
12d 5h
Merged PRs (30d)
2

Description

The test CqlListOperatorsTest.IncludedIn.IncludedInNullRight specifies the following CQL:

{'s', 'a', 'm'} included in null

and expects the result to be null. This is correct based on what is specified for IncludedIn:

For the interval-interval overload, if either argument is null, the result is null.

Unfortunately, the current CQL Translator does not translate this CQL correctly. Instead of correctly translating it as an IncludedIn expression with the 2nd operand being null as List<String>, it translates it as an In expression with the 2nd operand being null as Interval<List<String>> (which doesn't even make sense as a type). This causes the test to fail because In says:

If the second argument is null, the result is false.

So... engines that work off the mistranslated CQL will execute it using In semantics and will return false rather than the expected null.

This can be fixed by updating the test CQL expression to explicitly cast the null (e.g., {'s', 'a', 'm'} included in (null as List&lt;String&gt;)), but this should really be resolved by fixing the CQL Translator.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/cql/CqlListOperatorsTest.xml around lines 426-429 and reproduce the translation of {'s', 'a', 'm'} included in null. Compare the generated expression with the IncludedIn and In semantics linked in the issue; done when the expression uses a null List operand and the test result is null.

Written by the indexing model from the issue text.

Assessment

Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.