From 6ebadeae383115f7b749f96452509384f1422a08 Mon Sep 17 00:00:00 2001 From: Bryant Austin Date: Mon, 29 Jun 2026 10:58:52 -0600 Subject: [PATCH] additional tests as suggested by claude --- tests/cql/CqlAggregateFunctionsTest.xml | 160 ++++++++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/tests/cql/CqlAggregateFunctionsTest.xml b/tests/cql/CqlAggregateFunctionsTest.xml index b6369f9..a6353d6 100644 --- a/tests/cql/CqlAggregateFunctionsTest.xml +++ b/tests/cql/CqlAggregateFunctionsTest.xml @@ -44,6 +44,11 @@ AllTrue(null) true + + + AllTrue({null, null, null}) + true + @@ -97,6 +102,11 @@ AnyTrue(null) false + + + AnyTrue({null, null, null}) + false + @@ -105,6 +115,21 @@ Avg({ 1.0, 2.0, 3.0, 6.0 }) 3.0 + + + Avg({ 1.0, null, 3.0 }) + 2.0 + + + + Avg({ null as Decimal, null as Decimal }) + null + + + + Avg(null as List<Decimal>) + null + @@ -114,6 +139,24 @@ Product({5L, 4L, 5L}) 100L + + Product({ 2, 3, 4 }) + 24 + + + Product({ 1.0, 2.0, 3.0, 4.0 }) + 24.0 + + + + Product({ null as Decimal, null as Decimal }) + null + + + + Product(null as List<Decimal>) + null + @@ -139,6 +182,16 @@ Count({}) 0 + + + Count({ null, null, null }) + 0 + + + + Count(null as List<Integer>) + 0 + @@ -170,6 +223,25 @@ Max({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 }) @T20:59:59.999 + + Max({ 1.0, 5.0, 3.0 }) + 5.0 + + + + Max({ 1, null, 5 }) + 5 + + + + Max({ null as Quantity, null as Quantity, null as Quantity }) + null + + + + Max(null as List<Decimal>) + null + @@ -178,6 +250,19 @@ Median({6.0, 5.0, 4.0, 3.0, 2.0, 1.0}) 3.5 + + + Median({ 1.0, 2.0, 3.0 }) + 2.0 + + + Median({ null as Quantity, null as Quantity, null as Quantity }) + null + + + Median(null as List<Decimal>) + null + @@ -209,6 +294,18 @@ Min({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999 }) @T05:59:59.999 + + Min({ 5.0, 1.0, 3.0 }) + 1.0 + + + Min({ null as Quantity, null as Quantity, null as Quantity }) + null + + + Min(null as List<Decimal>) + null + @@ -235,6 +332,14 @@ Mode({ @T15:59:59.999, @T05:59:59.999, @T20:59:59.999, @T05:59:59.999 }) @T05:59:59.999 + + Mode({ null as Quantity, null as Quantity, null as Quantity }) + null + + + Mode(null as List<Decimal>) + null + @@ -249,6 +354,11 @@ PopulationStdDev({ null as Quantity, null as Quantity, null as Quantity }) null + + + PopulationStdDev(null as List<Decimal>) + null + @@ -262,6 +372,11 @@ PopulationVariance({ null as Quantity, null as Quantity, null as Quantity }) null + + + PopulationVariance(null as List<Decimal>) + null + @@ -276,6 +391,11 @@ StdDev({ null as Quantity, null as Quantity, null as Quantity }) null + + + StdDev(null as List<Decimal>) + null + @@ -301,6 +421,20 @@ Sum({ null, 1, null }) 1 + + Sum({ 1, 2, 3 }) + 6 + + + + Sum({ null as Decimal, null as Decimal }) + null + + + + Sum(null as List<Decimal>) + null + @@ -309,5 +443,31 @@ Variance({ 1.0, 2.0, 3.0, 4.0, 5.0 }) 2.5 + + Variance({ null as Quantity, null as Quantity, null as Quantity }) + null + + + + Variance(null as List<Decimal>) + null + + + + + + + GeometricMean({ 2.0, 8.0 }) + 4.0 + + + GeometricMean({ null as Decimal, null as Decimal }) + null + + + + GeometricMean(null as List<Decimal>) + null +