Conversation
|
Formatting check succeeded! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1394 +/- ##
============================================
+ Coverage 64.36% 64.37% +0.01%
Complexity 1921 1921
============================================
Files 494 494
Lines 28131 28131
Branches 5588 5588
============================================
+ Hits 18106 18110 +4
+ Misses 7772 7769 -3
+ Partials 2253 2252 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Depends on cqframework/cql-tests#40 |
| </test> | ||
| <test name="ProperIn9"> | ||
| <expression>'a' properly included in { 'a', null }</expression> | ||
| <output>null</output> |
There was a problem hiding this comment.
Seems like this should be true?
There was a problem hiding this comment.
Hi @brynrhodes my reading of the spec https://cql.hl7.org/04-logicalspecification.html#proper-in:
For the T, List overload, this operator returns [true] if the given element is in the given list, and it is not the only element in the list, using equality semantics, with the exception that null elements are considered equal. If the first argument is null, the result is true if the list contains any null elements and at least one other element, and false otherwise. If the second argument is null, the result is false.
is that:
null properly included in { 'a', null } = true // nulls are equal and there is at least one non-null in the list (spec is explicit)
null properly included in { null, null } = false // nulls are equal but there are no non-nulls in the list (spec is explicit)
'a' properly included in { 'a', 'b' } = true // the list has at least one element for which Equals(x, y) evaluates to true and at least one for which Equals(x, y) evaluates to false (spec is explicit)
'a' properly included in { 'a', 'b', null } = true // same as above
'a' properly included in { 'a', 'a' } = false // the list has at least one element for which Equals(x, y) evaluates to true, no elements for which Equals(x, y) evaluates to false, and no elements for which Equals(x, y) evaluates to null (spec is only explicit that the result is not true)
'a' properly included in { 'a', null } = null // the list has at least one element for which Equals(x, y) evaluates to true, no elements for which Equals(x, y) evaluates to false, but there are elements for which Equals(x, y) evaluates to null (spec is only explicit that the result is not true)
This is consistent with the existing null-valued ProperInTimeNull test in the same file that covers the ProperIn(T, Interval<T>) overload, indicating that we can return nulls from ProperIn, not just true and false.
What do you think?
There was a problem hiding this comment.
Also whichever we go with, I'll add the short explainers as comments to the XMLs.
* WIP * WIP * WIP * Working? * Fix usage of Java 17 API * Update checkstyle rules * Fix static analysis * Updates to src dirs * Fixing up missing test sourceSet * Try another way to specify the antlr directory * Third different way * Add some logging * merge master * Change toolchain resolution * Fix tests * More tweaks to animalsniffer * Fix formatting * Trying random stuff * More random stuff * Small improvements for Gradle build (#1418) * Removing references to idea * Fix duplicative generation * Remove references to idea project generation --------- Co-authored-by: Anton Vasetenkov <antvaset@gmail.com>
|



This PR adds tests for the ProperIn evaluator following the changes to ProperContains in #1393 to align it with the spec. Internally, ProperIn uses the ProperContains logic entirely because the operators are the same except for the order of the arguments.