CqlComparisonOperatorsTest: NotEquivalentNullNull marks `null !~ null` invalid, where the specification gives it as false
Maintainers usually reply within 5 days
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- testing
Research direction
Open tests/cql/CqlComparisonOperatorsTest.xml and find the NotEquivalentNullNull case. Compare its expected semantic error with the CQL 1.5.3 examples cited in the issue, which specify null !~ null as false. Update the expectation to match the specification, then confirm the case records false.
Written by the indexing model from the issue text.
Description
File: tests/cql/CqlComparisonOperatorsTest.xml, at main (f724ee4), test NotEquivalentNullNull (added in 01efa12):
<test name="NotEquivalentNullNull" version="1.0">
<expression invalid="semantic">null !~ null</expression>
</test>
What the specification says. CQL 1.5.3, Appendix B, Comparison Operators:
- Not Equivalent lists
define "NullNotEquivalentIsFalse": null !~ nullamong its examples. - Equivalent: "returns true if the arguments are equivalent in value, or if they are both null", and "this operator will always return true or false, even if either or both of its arguments are null"; its examples include
define "NullEquivalentIsTrue": null ~ null.
So null !~ null is a valid expression whose result is false.
What the test says. It expects a semantic error.
Why it may have been written this way. The Java translator (org.cqframework 5.4.0) refuses the expression: "Call to operator Equivalent(System.Any, System.Any) is ambiguous". That is a limit of overload resolution for two untyped nulls, not a rule of the language.
Proposed fix. Expect the specification's answer:
<test name="NotEquivalentNullNull" version="1.0">
<expression>null !~ null</expression>
<output>false</output>
</test>
Or, if refusing it is intended, say so in the specification, and remove the two examples.
Found from gofhir/cql (plan 012, docs/plans/012-suite-cql-tests.md). That engine answers false.
- Dominant language
- No language data
- Stars
- 8
- Forks
- 9
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cqframework/cql-tests
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cqframework/cql-tests#182 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
cqframework/cql-tests#170 ·
Maintainers usually reply within 5 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
cqframework/cql-tests#158 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cqframework/cql-tests#157 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cqframework/cql-tests#153 · 2 comments ·
Maintainers usually reply within 5 days
All issues in cqframework/cql-tests
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Possibly taken @cestercian claimed this today. Opencomp/cli P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#162259 · 1 comment ·
Maintainers usually reply within 1 day