From 4dd61c47d68d887a4d93e995408943eca596a6d3 Mon Sep 17 00:00:00 2001 From: Bryant Austin Date: Fri, 31 Jul 2026 09:33:20 -0600 Subject: [PATCH 1/2] Add support for tests that supply a complete CQL instead of a single , as needed by the overload-matching test in PR #61. --- tests/testSchema.xsd | 45 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/tests/testSchema.xsd b/tests/testSchema.xsd index 90b4f3e..bb4ab73 100644 --- a/tests/testSchema.xsd +++ b/tests/testSchema.xsd @@ -121,11 +121,27 @@ - + - The expression to be tested. + + The item under test: either a single CQL expression, or a complete CQL library. + Exactly one must be provided. Use 'library' instead of 'expression' when the test + requires library-level declarations (e.g. function overloads, parameters, includes, + or multiple named defines); the expected results are then matched to the library's + defines via the 'name' attribute on 'output'. + - + + + The expression to be tested. + + + + + The complete CQL library to be tested. + + + The expected output of the test. @@ -199,6 +215,24 @@ + + + + A complete CQL library provided as the body of the test. The content is the CQL source + text (including the 'library' declaration and any defines/functions). Results are matched + to individual defines via the 'name' attribute on the test's 'output' element(s). + + + + + + + Indicates whether the library is expected to translate/evaluate successfully, or to produce a syntax, semantic, or runtime error. + + + + + @@ -207,6 +241,11 @@ The type of the expected output. If output type is not present, the content of the output is the string representation of a literal (e.g. 10.0) + + + For library-style tests, the name of the define whose expected result this output describes (corresponds to a 'define' statement in the library). Omitted for single-expression tests. + + From ea8bf518093401b8d53fc27f4ddb9723495771da Mon Sep 17 00:00:00 2001 From: Bryant Austin Date: Fri, 31 Jul 2026 13:15:41 -0600 Subject: [PATCH 2/2] Add overload / conversion-precedence test cases Library-style tests exercising function-overload resolution and CQL conversion precedence (exact match vs implicit Integer->Decimal/Long, Decimal vs Quantity, and an ambiguous overload). Each is a self-contained CQL library with a unique name. Addresses #37. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/cql/CqlOverloadMatching.xml | 77 +++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 tests/cql/CqlOverloadMatching.xml diff --git a/tests/cql/CqlOverloadMatching.xml b/tests/cql/CqlOverloadMatching.xml new file mode 100644 index 0000000..eaf39d8 --- /dev/null +++ b/tests/cql/CqlOverloadMatching.xml @@ -0,0 +1,77 @@ + + + + + + library ExactIntegerOverThanConversion version '1.0.0' + + define function A(foo Integer): 'IntegerOverload' + define function A(foo Decimal): 'DecimalOverload' + + define output: A(1) + + 'IntegerOverload' + + + + + library ImplicitIntegerToDecimal version '1.0.0' + + define function A(foo Decimal): 'DecimalOverload' + + define output: A(1) + + 'DecimalOverload' + + + + + + library ExactLongOverload version '1.0.0' + + define function A(foo Integer): 'IntegerOverload' + define function A(foo Long): 'LongOverload' + + define output: A(1L) + + 'LongOverload' + + + + + + library ImplicitIntegerToLong version '1.0.0' + + define function A(foo Long): 'LongOverload' + + define output: A(1) + + 'LongOverload' + + + + + library ExactDecimalOverQuantity version '1.0.0' + + define function A(foo Decimal): 'DecimalOverload' + define function A(foo Quantity): 'QuantityOverload' + + define output: A(1.0) + + 'DecimalOverload' + + + + + + library AmbiguousOverload version '1.0.0' + + define function A(foo Long): 'LongOverload' + define function A(foo Decimal): 'DecimalOverload' + + define output: A(1) + + + +