CqlComparisonOperatorsTest: NotEquivalentNullNull marks `null !~ null` invalid, where the specification gives it as false

Open Beginner friendly
#172 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

@leftonmars is already working on this.

Since Nov 17, 2026.

  • #189 by @leftonmars — open

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 !~ null among 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

  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.

More from cqframework/cql-tests

All issues in cqframework/cql-tests

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.