diff --git a/src/test/java/eu/europa/ted/efx/sdk2/EfxExpressionTranslatorV2Test.java b/src/test/java/eu/europa/ted/efx/sdk2/EfxExpressionTranslatorV2Test.java index 02b26df1..203a7d42 100644 --- a/src/test/java/eu/europa/ted/efx/sdk2/EfxExpressionTranslatorV2Test.java +++ b/src/test/java/eu/europa/ted/efx/sdk2/EfxExpressionTranslatorV2Test.java @@ -50,7 +50,7 @@ void testLogicalAndCondition() { @Test void testInListCondition() { testExpressionTranslationWithContext("not('x' = ('a','b','c'))", "BT-00-Text", - "'x' not in ('a', 'b', 'c')"); + "'x' not in ['a', 'b', 'c']"); } @Test @@ -82,14 +82,14 @@ void testUniqueValueCondition_WithNot() { void testStringUniqueValueCondition_WithLiteralSequence() { testExpressionTranslationWithContext( "count(for $n in 'b', $x in ('a','b','c','b')[. = $n] return $x) = 1", - "BT-00-Text", "'b' is unique in ('a', 'b', 'c', 'b')"); + "BT-00-Text", "'b' is unique in ['a', 'b', 'c', 'b']"); } @Test void testNumericUniqueValueCondition_WithLiteralSequence() { testExpressionTranslationWithContext( "count(for $n in 2, $x in (1,2,3,2)[. = $n] return $x) = 1", - "BT-00-Number", "2 is unique in (1, 2, 3, 2)"); + "BT-00-Number", "2 is unique in [1, 2, 3, 2]"); } @Test @@ -103,7 +103,7 @@ void testStringUniqueValueCondition_WithRepeatableField() { void testStringUniqueValueCondition_WithNot() { testExpressionTranslationWithContext( "not(count(for $n in 'x', $x in ('a','b','c')[. = $n] return $x) = 1)", - "BT-00-Text", "'x' is not unique in ('a', 'b', 'c')"); + "BT-00-Text", "'x' is not unique in ['a', 'b', 'c']"); } @Test @@ -388,7 +388,7 @@ void testBooleanLiteralExpression_Never() { @Test void testStringQuantifiedExpression_UsingLiterals() { testExpressionTranslationWithContext("every $x in ('a','b','c') satisfies $x <= 'a'", "ND-Root", - "every text:$x in ('a', 'b', 'c') satisfies $x <= 'a'"); + "every text:$x in ['a', 'b', 'c'] satisfies $x <= 'a'"); } @Test @@ -400,7 +400,7 @@ void testStringQuantifiedExpression_UsingFieldReference() { @Test void testBooleanQuantifiedExpression_UsingLiterals() { testExpressionTranslationWithContext("every $x in (true(),false(),true()) satisfies $x", - "ND-Root", "every indicator:$x in (TRUE, FALSE, ALWAYS) satisfies $x"); + "ND-Root", "every indicator:$x in [TRUE, FALSE, ALWAYS] satisfies $x"); } @Test @@ -412,7 +412,7 @@ void testBooleanQuantifiedExpression_UsingFieldReference() { @Test void testNumericQuantifiedExpression_UsingLiterals() { testExpressionTranslationWithContext("every $x in (1,2,3) satisfies $x <= 1", "ND-Root", - "every number:$x in (1, 2, 3) satisfies $x <= 1"); + "every number:$x in [1, 2, 3] satisfies $x <= 1"); } @Test @@ -426,7 +426,7 @@ void testDateQuantifiedExpression_UsingLiterals() { testExpressionTranslationWithContext( "every $x in (xs:date('2012-01-01Z'),xs:date('2012-01-02Z'),xs:date('2012-01-03Z')) satisfies $x <= xs:date('2012-01-01Z')", "ND-Root", - "every date:$x in (2012-01-01Z, 2012-01-02Z, 2012-01-03Z) satisfies $x <= 2012-01-01Z"); + "every date:$x in [2012-01-01Z, 2012-01-02Z, 2012-01-03Z] satisfies $x <= 2012-01-01Z"); } @Test @@ -441,14 +441,14 @@ void testDateQuantifiedExpression_UsingMultipleIterators() { testExpressionTranslationWithContext( "every $x in PathNode/StartDateField/xs:date(text()), $y in ($x,xs:date('2022-02-02Z')), $i in (true(),true()) satisfies $x <= xs:date('2012-01-01Z')", "ND-Root", - "every date:$x in BT-00-StartDate, date:$y in ($x, 2022-02-02Z), indicator:$i in (ALWAYS, TRUE) satisfies $x <= 2012-01-01Z"); + "every date:$x in BT-00-StartDate, date:$y in [$x, 2022-02-02Z], indicator:$i in [ALWAYS, TRUE] satisfies $x <= 2012-01-01Z"); } @Test void testTimeQuantifiedExpression_UsingLiterals() { testExpressionTranslationWithContext( "every $x in (xs:time('00:00:00Z'),xs:time('00:00:01Z'),xs:time('00:00:02Z')) satisfies $x <= xs:time('00:00:00Z')", - "ND-Root", "every time:$x in (00:00:00Z, 00:00:01Z, 00:00:02Z) satisfies $x <= 00:00:00Z"); + "ND-Root", "every time:$x in [00:00:00Z, 00:00:01Z, 00:00:02Z] satisfies $x <= 00:00:00Z"); } @Test @@ -462,7 +462,7 @@ void testTimeQuantifiedExpression_UsingFieldReference() { void testDurationQuantifiedExpression_UsingLiterals() { testExpressionTranslationWithContext( "every $x in (xs:dayTimeDuration('P1D'),xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P3D')) satisfies boolean(for $T in (current-date()) return ($T + $x <= $T + xs:dayTimeDuration('P1D')))", - "ND-Root", "every measure:$x in (P1D, P2D, P3D) satisfies $x <= P1D"); + "ND-Root", "every measure:$x in [P1D, P2D, P3D] satisfies $x <= P1D"); } @Test @@ -566,7 +566,7 @@ void testConditionalDurationExpression() { void testStringsFromStringIteration_UsingLiterals() { testExpressionTranslationWithContext( "'a' = (for $x in ('a','b','c') return concat($x, 'text'))", "ND-Root", - "'a' in (for text:$x in ('a', 'b', 'c') return concat($x, 'text'))"); + "'a' in (for text:$x in ['a', 'b', 'c'] return concat($x, 'text'))"); } @Test @@ -574,7 +574,7 @@ void testStringsSequenceFromIteration_UsingMultipleIterators() { testExpressionTranslationWithContext( "'a' = (for $x in ('a','b','c'), $y in (1,2), $z in PathNode/IndicatorField return concat($x, string($y), 'text'))", "ND-Root", - "'a' in (for text:$x in ('a', 'b', 'c'), number:$y in (1, 2), indicator:$z in BT-00-Indicator return concat($x, string($y), 'text'))"); + "'a' in (for text:$x in ['a', 'b', 'c'], number:$y in [1, 2], indicator:$z in BT-00-Indicator return concat($x, string($y), 'text'))"); } @Test @@ -612,7 +612,7 @@ void testStringsFromStringIteration_UsingMultilingualFieldReference() { @Test void testStringsFromBooleanIteration_UsingLiterals() { testExpressionTranslationWithContext("'a' = (for $x in (true(),false()) return 'y')", "ND-Root", - "'a' in (for indicator:$x in (TRUE, FALSE) return 'y')"); + "'a' in (for indicator:$x in [TRUE, FALSE] return 'y')"); } @Test @@ -625,7 +625,7 @@ void testStringsFromBooleanIteration_UsingFieldReference() { @Test void testStringsFromNumericIteration_UsingLiterals() { testExpressionTranslationWithContext("'a' = (for $x in (1,2,3) return 'y')", "ND-Root", - "'a' in (for number:$x in (1, 2, 3) return 'y')"); + "'a' in (for number:$x in [1, 2, 3] return 'y')"); } @Test @@ -638,7 +638,7 @@ void testStringsFromNumericIteration_UsingFieldReference() { void testStringsFromDateIteration_UsingLiterals() { testExpressionTranslationWithContext( "'a' = (for $x in (xs:date('2012-01-01Z'),xs:date('2012-01-02Z'),xs:date('2012-01-03Z')) return 'y')", - "ND-Root", "'a' in (for date:$x in (2012-01-01Z, 2012-01-02Z, 2012-01-03Z) return 'y')"); + "ND-Root", "'a' in (for date:$x in [2012-01-01Z, 2012-01-02Z, 2012-01-03Z] return 'y')"); } @Test @@ -651,7 +651,7 @@ void testStringsFromDateIteration_UsingFieldReference() { void testStringsFromTimeIteration_UsingLiterals() { testExpressionTranslationWithContext( "'a' = (for $x in (xs:time('12:00:00Z'),xs:time('12:00:01Z'),xs:time('12:00:02Z')) return 'y')", - "ND-Root", "'a' in (for time:$x in (12:00:00Z, 12:00:01Z, 12:00:02Z) return 'y')"); + "ND-Root", "'a' in (for time:$x in [12:00:00Z, 12:00:01Z, 12:00:02Z] return 'y')"); } @Test @@ -664,7 +664,7 @@ void testStringsFromTimeIteration_UsingFieldReference() { void testStringsFromDurationIteration_UsingLiterals() { testExpressionTranslationWithContext( "'a' = (for $x in (xs:dayTimeDuration('P1D'),xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2M')) return 'y')", - "ND-Root", "'a' in (for measure:$x in (P1D, P1Y, P2M) return 'y')"); + "ND-Root", "'a' in (for measure:$x in [P1D, P1Y, P2M] return 'y')"); } @@ -679,7 +679,7 @@ void testStringsFromDurationIteration_UsingFieldReference() { @Test void testNumbersFromStringIteration_UsingLiterals() { testExpressionTranslationWithContext("123 = (for $x in ('a','b','c') return number($x))", - "ND-Root", "123 in (for text:$x in ('a', 'b', 'c') return number($x))"); + "ND-Root", "123 in (for text:$x in ['a', 'b', 'c'] return number($x))"); } @Test @@ -692,7 +692,7 @@ void testNumbersFromStringIteration_UsingFieldReference() { @Test void testNumbersFromBooleanIteration_UsingLiterals() { testExpressionTranslationWithContext("123 = (for $x in (true(),false()) return 0)", "ND-Root", - "123 in (for indicator:$x in (TRUE, FALSE) return 0)"); + "123 in (for indicator:$x in [TRUE, FALSE] return 0)"); } @Test @@ -705,7 +705,7 @@ void testNumbersFromBooleanIteration_UsingFieldReference() { @Test void testNumbersFromNumericIteration_UsingLiterals() { testExpressionTranslationWithContext("123 = (for $x in (1,2,3) return 0)", "ND-Root", - "123 in (for number:$x in (1, 2, 3) return 0)"); + "123 in (for number:$x in [1, 2, 3] return 0)"); } @Test @@ -718,7 +718,7 @@ void testNumbersFromNumericIteration_UsingFieldReference() { void testNumbersFromDateIteration_UsingLiterals() { testExpressionTranslationWithContext( "123 = (for $x in (xs:date('2012-01-01Z'),xs:date('2012-01-02Z'),xs:date('2012-01-03Z')) return 0)", - "ND-Root", "123 in (for date:$x in (2012-01-01Z, 2012-01-02Z, 2012-01-03Z) return 0)"); + "ND-Root", "123 in (for date:$x in [2012-01-01Z, 2012-01-02Z, 2012-01-03Z] return 0)"); } @Test @@ -731,7 +731,7 @@ void testNumbersFromDateIteration_UsingFieldReference() { void testNumbersFromTimeIteration_UsingLiterals() { testExpressionTranslationWithContext( "123 = (for $x in (xs:time('12:00:00Z'),xs:time('12:00:01Z'),xs:time('12:00:02Z')) return 0)", - "ND-Root", "123 in (for time:$x in (12:00:00Z, 12:00:01Z, 12:00:02Z) return 0)"); + "ND-Root", "123 in (for time:$x in [12:00:00Z, 12:00:01Z, 12:00:02Z] return 0)"); } @Test @@ -744,7 +744,7 @@ void testNumbersFromTimeIteration_UsingFieldReference() { void testNumbersFromDurationIteration_UsingLiterals() { testExpressionTranslationWithContext( "123 = (for $x in (xs:dayTimeDuration('P1D'),xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2M')) return 0)", - "ND-Root", "123 in (for measure:$x in (P1D, P1Y, P2M) return 0)"); + "ND-Root", "123 in (for measure:$x in [P1D, P1Y, P2M] return 0)"); } @@ -760,7 +760,7 @@ void testNumbersFromDurationIteration_UsingFieldReference() { void testDatesFromStringIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:date('2022-01-01Z') = (for $x in ('a','b','c') return xs:date($x))", "ND-Root", - "2022-01-01Z in (for text:$x in ('a', 'b', 'c') return date($x))"); + "2022-01-01Z in (for text:$x in ['a', 'b', 'c'] return date($x))"); } @Test @@ -775,7 +775,7 @@ void testDatesFromStringIteration_UsingFieldReference() { void testDatesFromBooleanIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:date('2022-01-01Z') = (for $x in (true(),false()) return xs:date('2022-01-01Z'))", - "ND-Root", "2022-01-01Z in (for indicator:$x in (TRUE, FALSE) return 2022-01-01Z)"); + "ND-Root", "2022-01-01Z in (for indicator:$x in [TRUE, FALSE] return 2022-01-01Z)"); } @Test @@ -790,7 +790,7 @@ void testDatesFromBooleanIteration_UsingFieldReference() { void testDatesFromNumericIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:date('2022-01-01Z') = (for $x in (1,2,3) return xs:date('2022-01-01Z'))", "ND-Root", - "2022-01-01Z in (for number:$x in (1, 2, 3) return 2022-01-01Z)"); + "2022-01-01Z in (for number:$x in [1, 2, 3] return 2022-01-01Z)"); } @Test @@ -805,7 +805,7 @@ void testDatesFromDateIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:date('2022-01-01Z') = (for $x in (xs:date('2012-01-01Z'),xs:date('2012-01-02Z'),xs:date('2012-01-03Z')) return xs:date('2022-01-01Z'))", "ND-Root", - "2022-01-01Z in (for date:$x in (2012-01-01Z, 2012-01-02Z, 2012-01-03Z) return 2022-01-01Z)"); + "2022-01-01Z in (for date:$x in [2012-01-01Z, 2012-01-02Z, 2012-01-03Z] return 2022-01-01Z)"); } @Test @@ -820,7 +820,7 @@ void testDatesFromTimeIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:date('2022-01-01Z') = (for $x in (xs:time('12:00:00Z'),xs:time('12:00:01Z'),xs:time('12:00:02Z')) return xs:date('2022-01-01Z'))", "ND-Root", - "2022-01-01Z in (for time:$x in (12:00:00Z, 12:00:01Z, 12:00:02Z) return 2022-01-01Z)"); + "2022-01-01Z in (for time:$x in [12:00:00Z, 12:00:01Z, 12:00:02Z] return 2022-01-01Z)"); } @Test @@ -834,7 +834,7 @@ void testDatesFromTimeIteration_UsingFieldReference() { void testDatesFromDurationIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:date('2022-01-01Z') = (for $x in (xs:dayTimeDuration('P1D'),xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2M')) return xs:date('2022-01-01Z'))", - "ND-Root", "2022-01-01Z in (for measure:$x in (P1D, P1Y, P2M) return 2022-01-01Z)"); + "ND-Root", "2022-01-01Z in (for measure:$x in [P1D, P1Y, P2M] return 2022-01-01Z)"); } @@ -851,7 +851,7 @@ void testDatesFromDurationIteration_UsingFieldReference() { void testTimesFromStringIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:time('12:00:00Z') = (for $x in ('a','b','c') return xs:time($x))", "ND-Root", - "12:00:00Z in (for text:$x in ('a', 'b', 'c') return time($x))"); + "12:00:00Z in (for text:$x in ['a', 'b', 'c'] return time($x))"); } @Test @@ -866,7 +866,7 @@ void testTimesFromStringIteration_UsingFieldReference() { void testTimesFromBooleanIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:time('12:00:00Z') = (for $x in (true(),false()) return xs:time('12:00:00Z'))", - "ND-Root", "12:00:00Z in (for indicator:$x in (TRUE, FALSE) return 12:00:00Z)"); + "ND-Root", "12:00:00Z in (for indicator:$x in [TRUE, FALSE] return 12:00:00Z)"); } @Test @@ -881,7 +881,7 @@ void testTimesFromBooleanIteration_UsingFieldReference() { void testTimesFromNumericIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:time('12:00:00Z') = (for $x in (1,2,3) return xs:time('12:00:00Z'))", "ND-Root", - "12:00:00Z in (for number:$x in (1, 2, 3) return 12:00:00Z)"); + "12:00:00Z in (for number:$x in [1, 2, 3] return 12:00:00Z)"); } @Test @@ -896,7 +896,7 @@ void testTimesFromDateIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:time('12:00:00Z') = (for $x in (xs:date('2012-01-01Z'),xs:date('2012-01-02Z'),xs:date('2012-01-03Z')) return xs:time('12:00:00Z'))", "ND-Root", - "12:00:00Z in (for date:$x in (2012-01-01Z, 2012-01-02Z, 2012-01-03Z) return 12:00:00Z)"); + "12:00:00Z in (for date:$x in [2012-01-01Z, 2012-01-02Z, 2012-01-03Z] return 12:00:00Z)"); } @Test @@ -911,7 +911,7 @@ void testTimesFromTimeIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:time('12:00:00Z') = (for $x in (xs:time('12:00:00Z'),xs:time('12:00:01Z'),xs:time('12:00:02Z')) return xs:time('12:00:00Z'))", "ND-Root", - "12:00:00Z in (for time:$x in (12:00:00Z, 12:00:01Z, 12:00:02Z) return 12:00:00Z)"); + "12:00:00Z in (for time:$x in [12:00:00Z, 12:00:01Z, 12:00:02Z] return 12:00:00Z)"); } @Test @@ -925,7 +925,7 @@ void testTimesFromTimeIteration_UsingFieldReference() { void testTimesFromDurationIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:time('12:00:00Z') = (for $x in (xs:dayTimeDuration('P1D'),xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2M')) return xs:time('12:00:00Z'))", - "ND-Root", "12:00:00Z in (for measure:$x in (P1D, P1Y, P2M) return 12:00:00Z)"); + "ND-Root", "12:00:00Z in (for measure:$x in [P1D, P1Y, P2M] return 12:00:00Z)"); } @@ -942,7 +942,7 @@ void testTimesFromDurationIteration_UsingFieldReference() { void testDurationsFromStringIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:dayTimeDuration('P1D') = (for $x in (xs:dayTimeDuration('P1D'),xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P7D')) return $x)", - "ND-Root", "P1D in (for measure:$x in (P1D, P2D, P1W) return $x)"); + "ND-Root", "P1D in (for measure:$x in [P1D, P2D, P1W] return $x)"); } @Test @@ -957,7 +957,7 @@ void testDurationsFromStringIteration_UsingFieldReference() { void testDurationsFromBooleanIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:dayTimeDuration('P1D') = (for $x in (true(),false()) return xs:dayTimeDuration('P1D'))", - "ND-Root", "P1D in (for indicator:$x in (TRUE, FALSE) return P1D)"); + "ND-Root", "P1D in (for indicator:$x in [TRUE, FALSE] return P1D)"); } @Test @@ -972,7 +972,7 @@ void testDurationsFromBooleanIteration_UsingFieldReference() { void testDurationsFromNumericIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:dayTimeDuration('P1D') = (for $x in (1,2,3) return xs:dayTimeDuration('P1D'))", - "ND-Root", "P1D in (for number:$x in (1, 2, 3) return P1D)"); + "ND-Root", "P1D in (for number:$x in [1, 2, 3] return P1D)"); } @Test @@ -986,7 +986,7 @@ void testDurationsFromNumericIteration_UsingFieldReference() { void testDurationsFromDateIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:dayTimeDuration('P1D') = (for $x in (xs:date('2012-01-01Z'),xs:date('2012-01-02Z'),xs:date('2012-01-03Z')) return xs:dayTimeDuration('P1D'))", - "ND-Root", "P1D in (for date:$x in (2012-01-01Z, 2012-01-02Z, 2012-01-03Z) return P1D)"); + "ND-Root", "P1D in (for date:$x in [2012-01-01Z, 2012-01-02Z, 2012-01-03Z] return P1D)"); } @Test @@ -1000,7 +1000,7 @@ void testDurationsFromDateIteration_UsingFieldReference() { void testDurationsFromTimeIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:dayTimeDuration('P1D') = (for $x in (xs:time('12:00:00Z'),xs:time('12:00:01Z'),xs:time('12:00:02Z')) return xs:dayTimeDuration('P1D'))", - "ND-Root", "P1D in (for time:$x in (12:00:00Z, 12:00:01Z, 12:00:02Z) return P1D)"); + "ND-Root", "P1D in (for time:$x in [12:00:00Z, 12:00:01Z, 12:00:02Z] return P1D)"); } @Test @@ -1014,7 +1014,7 @@ void testDurationsFromTimeIteration_UsingFieldReference() { void testDurationsFromDurationIteration_UsingLiterals() { testExpressionTranslationWithContext( "xs:dayTimeDuration('P1D') = (for $x in (xs:dayTimeDuration('P1D'),xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2M')) return xs:dayTimeDuration('P1D'))", - "ND-Root", "P1D in (for measure:$x in (P1D, P1Y, P2M) return P1D)"); + "ND-Root", "P1D in (for measure:$x in [P1D, P1Y, P2M] return P1D)"); } @Test @@ -1055,51 +1055,51 @@ void testNumericLiteralExpression() { @Test void testStringList() { testExpressionTranslationWithContext("'a' = ('a','b','c')", "BT-00-Text", - "'a' in ('a', 'b', 'c')"); + "'a' in ['a', 'b', 'c']"); } @Test void testNumericList_UsingNumericLiterals() { - testExpressionTranslationWithContext("4 = (1,2,3)", "BT-00-Text", "4 in (1, 2, 3)"); + testExpressionTranslationWithContext("4 = (1,2,3)", "BT-00-Text", "4 in [1, 2, 3]"); } @Test void testNumericList_UsingNumericField() { testExpressionTranslationWithContext("4 = (1,../NumberField/number(),3)", "BT-00-Text", - "4 in (1, BT-00-Number, 3)"); + "4 in [1, BT-00-Number, 3]"); } @Test void testNumericList_UsingTextField() { assertThrows(ParseCancellationException.class, - () -> translateExpressionWithContext("BT-00-Text", "4 in (1, BT-00-Text, 3)")); + () -> translateExpressionWithContext("BT-00-Text", "4 in [1, BT-00-Text, 3]")); } @Test void testBooleanList() { testExpressionTranslationWithContext("false() = (true(),PathNode/IndicatorField,true())", - "ND-Root", "NEVER in (TRUE, BT-00-Indicator, ALWAYS)"); + "ND-Root", "NEVER in [TRUE, BT-00-Indicator, ALWAYS]"); } @Test void testDateList() { testExpressionTranslationWithContext( "xs:date('2022-01-01Z') = (xs:date('2022-01-02Z'),PathNode/StartDateField/xs:date(text()),xs:date('2022-02-02Z'))", - "ND-Root", "2022-01-01Z in (2022-01-02Z, BT-00-StartDate, 2022-02-02Z)"); + "ND-Root", "2022-01-01Z in [2022-01-02Z, BT-00-StartDate, 2022-02-02Z]"); } @Test void testTimeList() { testExpressionTranslationWithContext( "xs:time('12:20:21Z') = (xs:time('12:30:00Z'),PathNode/StartTimeField/xs:time(text()),xs:time('13:40:00Z'))", - "ND-Root", "12:20:21Z in (12:30:00Z, BT-00-StartTime, 13:40:00Z)"); + "ND-Root", "12:20:21Z in [12:30:00Z, BT-00-StartTime, 13:40:00Z]"); } @Test void testDurationList_UsingDurationLiterals() { testExpressionTranslationWithContext( "xs:yearMonthDuration('P3M') = (xs:yearMonthDuration('P1M'),xs:yearMonthDuration('P3M'),xs:yearMonthDuration('P6M'))", - "BT-00-Text", "P3M in (P1M, P3M, P6M)"); + "BT-00-Text", "P3M in [P1M, P3M, P6M]"); } @@ -1108,7 +1108,7 @@ void testDurationList_UsingDurationLiterals() { void testDurationList_UsingDurationField() { assertEquals( "(for $F in ../MeasureField return (if ($F/@unitCode='WEEK') then xs:dayTimeDuration(concat('P', $F/number() * 7, 'D')) else if ($F/@unitCode='DAY') then xs:dayTimeDuration(concat('P', $F/number(), 'D')) else if ($F/@unitCode='YEAR') then xs:yearMonthDuration(concat('P', $F/number(), 'Y')) else if ($F/@unitCode='MONTH') then xs:yearMonthDuration(concat('P', $F/number(), 'M')) else ())) = (xs:yearMonthDuration('P1M'),xs:yearMonthDuration('P3M'),xs:yearMonthDuration('P6M'))", - translateExpressionWithContext("BT-00-Text", "BT-00-Measure in (P1M, P3M, P6M)")); + translateExpressionWithContext("BT-00-Text", "BT-00-Measure in [P1M, P3M, P6M]")); } @Test @@ -2100,7 +2100,7 @@ void testConcatFunction() { @Test void testStringJoinFunction_withLiterals() { testExpressionTranslationWithContext("string-join(('abc','def'), ',')", "ND-Root", - "string-join(('abc', 'def'), ',')"); + "string-join(['abc', 'def'], ',')"); } @Test @@ -2179,39 +2179,39 @@ void testYearMonthDurationFromStringFunction() { @Test void testDistinctValuesFunction_WithStringSequences() { testExpressionTranslationWithContext("distinct-values(('one','two','one'))", "ND-Root", - "distinct-values(('one', 'two', 'one'))"); + "distinct-values(['one', 'two', 'one'])"); } @Test void testDistinctValuesFunction_WithNumberSequences() { testExpressionTranslationWithContext("distinct-values((1,2,3,2,3,4))", "ND-Root", - "distinct-values((1, 2, 3, 2, 3, 4))"); + "distinct-values([1, 2, 3, 2, 3, 4])"); } @Test void testDistinctValuesFunction_WithDateSequences() { testExpressionTranslationWithContext( "distinct-values((xs:date('2018-01-01Z'),xs:date('2020-01-01Z'),xs:date('2018-01-01Z'),xs:date('2022-01-02Z')))", - "ND-Root", "distinct-values((2018-01-01Z, 2020-01-01Z, 2018-01-01Z, 2022-01-02Z))"); + "ND-Root", "distinct-values([2018-01-01Z, 2020-01-01Z, 2018-01-01Z, 2022-01-02Z])"); } @Test void testDistinctValuesFunction_WithTimeSequences() { testExpressionTranslationWithContext( "distinct-values((xs:time('12:00:00Z'),xs:time('13:00:00Z'),xs:time('12:00:00Z'),xs:time('14:00:00Z')))", - "ND-Root", "distinct-values((12:00:00Z, 13:00:00Z, 12:00:00Z, 14:00:00Z))"); + "ND-Root", "distinct-values([12:00:00Z, 13:00:00Z, 12:00:00Z, 14:00:00Z])"); } @Test void testDistinctValuesFunction_WithDurationSequences() { testExpressionTranslationWithContext("distinct-values((xs:dayTimeDuration('P7D'),xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P5D')))", - "ND-Root", "distinct-values((P1W, P2D, P2D, P5D))"); + "ND-Root", "distinct-values([P1W, P2D, P2D, P5D])"); } @Test void testDistinctValuesFunction_WithBooleanSequences() { testExpressionTranslationWithContext("distinct-values((true(),false(),false(),false()))", - "ND-Root", "distinct-values((TRUE, FALSE, FALSE, NEVER))"); + "ND-Root", "distinct-values([TRUE, FALSE, FALSE, NEVER])"); } @Test @@ -2225,39 +2225,39 @@ void testDistinctValuesFunction_WithFieldReferences() { @Test void testUnionFunction_WithStringSequences() { testExpressionTranslationWithContext("distinct-values((('one','two'), ('two','three','four')))", - "ND-Root", "value-union(('one', 'two'), ('two', 'three', 'four'))"); + "ND-Root", "value-union(['one', 'two'], ['two', 'three', 'four'])"); } @Test void testUnionFunction_WithNumberSequences() { testExpressionTranslationWithContext("distinct-values(((1,2,3), (2,3,4)))", "ND-Root", - "value-union((1, 2, 3), (2, 3, 4))"); + "value-union([1, 2, 3], [2, 3, 4])"); } @Test void testUnionFunction_WithDateSequences() { testExpressionTranslationWithContext( "distinct-values(((xs:date('2018-01-01Z'),xs:date('2020-01-01Z')), (xs:date('2018-01-01Z'),xs:date('2022-01-02Z'))))", - "ND-Root", "value-union((2018-01-01Z, 2020-01-01Z), (2018-01-01Z, 2022-01-02Z))"); + "ND-Root", "value-union([2018-01-01Z, 2020-01-01Z], [2018-01-01Z, 2022-01-02Z])"); } @Test void testUnionFunction_WithTimeSequences() { testExpressionTranslationWithContext( "distinct-values(((xs:time('12:00:00Z'),xs:time('13:00:00Z')), (xs:time('12:00:00Z'),xs:time('14:00:00Z'))))", - "ND-Root", "value-union((12:00:00Z, 13:00:00Z), (12:00:00Z, 14:00:00Z))"); + "ND-Root", "value-union([12:00:00Z, 13:00:00Z], [12:00:00Z, 14:00:00Z])"); } @Test void testUnionFunction_WithDurationSequences() { testExpressionTranslationWithContext("distinct-values(((xs:dayTimeDuration('P7D'),xs:dayTimeDuration('P2D')), (xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P5D'))))", - "ND-Root", "value-union((P1W, P2D), (P2D, P5D))"); + "ND-Root", "value-union([P1W, P2D], [P2D, P5D])"); } @Test void testUnionFunction_WithBooleanSequences() { testExpressionTranslationWithContext("distinct-values(((true(),false()), (false(),false())))", - "ND-Root", "value-union((TRUE, FALSE), (FALSE, NEVER))"); + "ND-Root", "value-union([TRUE, FALSE], [FALSE, NEVER])"); } @Test @@ -2281,39 +2281,39 @@ void testUnionFunction_WithTypeMismatch() { void testIntersectFunction_WithStringSequences() { testExpressionTranslationWithContext( "distinct-values(for $L1 in ('one','two') return if (some $L2 in ('two','three','four') satisfies $L1 = $L2) then $L1 else ())", "ND-Root", - "value-intersect(('one', 'two'), ('two', 'three', 'four'))"); + "value-intersect(['one', 'two'], ['two', 'three', 'four'])"); } @Test void testIntersectFunction_WithNumberSequences() { testExpressionTranslationWithContext("distinct-values(for $L1 in (1,2,3) return if (some $L2 in (2,3,4) satisfies $L1 = $L2) then $L1 else ())", "ND-Root", - "value-intersect((1, 2, 3), (2, 3, 4))"); + "value-intersect([1, 2, 3], [2, 3, 4])"); } @Test void testIntersectFunction_WithDateSequences() { testExpressionTranslationWithContext( "distinct-values(for $L1 in (xs:date('2018-01-01Z'),xs:date('2020-01-01Z')) return if (some $L2 in (xs:date('2018-01-01Z'),xs:date('2022-01-02Z')) satisfies $L1 = $L2) then $L1 else ())", - "ND-Root", "value-intersect((2018-01-01Z, 2020-01-01Z), (2018-01-01Z, 2022-01-02Z))"); + "ND-Root", "value-intersect([2018-01-01Z, 2020-01-01Z], [2018-01-01Z, 2022-01-02Z])"); } @Test void testIntersectFunction_WithTimeSequences() { testExpressionTranslationWithContext( "distinct-values(for $L1 in (xs:time('12:00:00Z'),xs:time('13:00:00Z')) return if (some $L2 in (xs:time('12:00:00Z'),xs:time('14:00:00Z')) satisfies $L1 = $L2) then $L1 else ())", - "ND-Root", "value-intersect((12:00:00Z, 13:00:00Z), (12:00:00Z, 14:00:00Z))"); + "ND-Root", "value-intersect([12:00:00Z, 13:00:00Z], [12:00:00Z, 14:00:00Z])"); } @Test void testIntersectFunction_WithDurationSequences() { testExpressionTranslationWithContext("distinct-values(for $L1 in (xs:dayTimeDuration('P7D'),xs:dayTimeDuration('P2D')) return if (some $L2 in (xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P5D')) satisfies $L1 = $L2) then $L1 else ())", - "ND-Root", "value-intersect((P1W, P2D), (P2D, P5D))"); + "ND-Root", "value-intersect([P1W, P2D], [P2D, P5D])"); } @Test void testIntersectFunction_WithBooleanSequences() { testExpressionTranslationWithContext("distinct-values(for $L1 in (true(),false()) return if (some $L2 in (false(),false()) satisfies $L1 = $L2) then $L1 else ())", - "ND-Root", "value-intersect((TRUE, FALSE), (FALSE, NEVER))"); + "ND-Root", "value-intersect([TRUE, FALSE], [FALSE, NEVER])"); } @Test @@ -2337,41 +2337,41 @@ void testIntersectFunction_WithTypeMismatch() { void testExceptFunction_WithStringSequences() { testExpressionTranslationWithContext( "distinct-values(for $L1 in ('one','two') return if (every $L2 in ('two','three','four') satisfies $L1 != $L2) then $L1 else ())", "ND-Root", - "value-except(('one', 'two'), ('two', 'three', 'four'))"); + "value-except(['one', 'two'], ['two', 'three', 'four'])"); } @Test void testExceptFunction_WithNumberSequences() { testExpressionTranslationWithContext("distinct-values(for $L1 in (1,2,3) return if (every $L2 in (2,3,4) satisfies $L1 != $L2) then $L1 else ())", "ND-Root", - "value-except((1, 2, 3), (2, 3, 4))"); + "value-except([1, 2, 3], [2, 3, 4])"); } @Test void testExceptFunction_WithDateSequences() { testExpressionTranslationWithContext( "distinct-values(for $L1 in (xs:date('2018-01-01Z'),xs:date('2020-01-01Z')) return if (every $L2 in (xs:date('2018-01-01Z'),xs:date('2022-01-02Z')) satisfies $L1 != $L2) then $L1 else ())", - "ND-Root", "value-except((2018-01-01Z, 2020-01-01Z), (2018-01-01Z, 2022-01-02Z))"); + "ND-Root", "value-except([2018-01-01Z, 2020-01-01Z], [2018-01-01Z, 2022-01-02Z])"); } @Test void testExceptFunction_WithTimeSequences() { testExpressionTranslationWithContext( "distinct-values(for $L1 in (xs:time('12:00:00Z'),xs:time('13:00:00Z')) return if (every $L2 in (xs:time('12:00:00Z'),xs:time('14:00:00Z')) satisfies $L1 != $L2) then $L1 else ())", - "ND-Root", "value-except((12:00:00Z, 13:00:00Z), (12:00:00Z, 14:00:00Z))"); + "ND-Root", "value-except([12:00:00Z, 13:00:00Z], [12:00:00Z, 14:00:00Z])"); } @Test void testExceptFunction_WithDurationSequences() { testExpressionTranslationWithContext( "distinct-values(for $L1 in (xs:dayTimeDuration('P7D'),xs:dayTimeDuration('P2D')) return if (every $L2 in (xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P5D')) satisfies $L1 != $L2) then $L1 else ())", - "ND-Root", "value-except((P1W, P2D), (P2D, P5D))"); + "ND-Root", "value-except([P1W, P2D], [P2D, P5D])"); } @Test void testExceptFunction_WithBooleanSequences() { testExpressionTranslationWithContext( "distinct-values(for $L1 in (true(),false()) return if (every $L2 in (false(),false()) satisfies $L1 != $L2) then $L1 else ())", "ND-Root", - "value-except((TRUE, FALSE), (FALSE, NEVER))"); + "value-except([TRUE, FALSE], [FALSE, NEVER])"); } @Test @@ -2423,39 +2423,39 @@ void testExceptFunction_WithTypeMismatch() { @Test void testSortFunction_WithStringSequences() { testExpressionTranslationWithContext("sort(('banana','apple','cherry'))", "ND-Root", - "sort(('banana', 'apple', 'cherry'))"); + "sort(['banana', 'apple', 'cherry'])"); } @Test void testSortFunction_WithNumberSequences() { testExpressionTranslationWithContext("sort((3,1,2))", "ND-Root", - "sort((3, 1, 2))"); + "sort([3, 1, 2])"); } @Test void testSortFunction_WithDateSequences() { testExpressionTranslationWithContext( "sort((xs:date('2022-01-01Z'),xs:date('2018-01-01Z'),xs:date('2020-01-01Z')))", - "ND-Root", "sort((2022-01-01Z, 2018-01-01Z, 2020-01-01Z))"); + "ND-Root", "sort([2022-01-01Z, 2018-01-01Z, 2020-01-01Z])"); } @Test void testSortFunction_WithTimeSequences() { testExpressionTranslationWithContext( "sort((xs:time('14:00:00Z'),xs:time('12:00:00Z'),xs:time('13:00:00Z')))", - "ND-Root", "sort((14:00:00Z, 12:00:00Z, 13:00:00Z))"); + "ND-Root", "sort([14:00:00Z, 12:00:00Z, 13:00:00Z])"); } @Test void testSortFunction_WithDurationSequences() { testExpressionTranslationWithContext("sort((xs:dayTimeDuration('P5D'),xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P7D')))", - "ND-Root", "sort((P5D, P2D, P1W))"); + "ND-Root", "sort([P5D, P2D, P1W])"); } @Test void testSortFunction_WithBooleanSequences() { testExpressionTranslationWithContext("sort((true(),false(),true()))", - "ND-Root", "sort((TRUE, FALSE, TRUE))"); + "ND-Root", "sort([TRUE, FALSE, TRUE])"); } @Test @@ -2478,39 +2478,39 @@ void testSortFunction_WithRepeatableFieldReference() { @Test void testReverseFunction_WithStringSequences() { testExpressionTranslationWithContext("reverse(('banana','apple','cherry'))", "ND-Root", - "reverse(('banana', 'apple', 'cherry'))"); + "reverse(['banana', 'apple', 'cherry'])"); } @Test void testReverseFunction_WithNumberSequences() { testExpressionTranslationWithContext("reverse((3,1,2))", "ND-Root", - "reverse((3, 1, 2))"); + "reverse([3, 1, 2])"); } @Test void testReverseFunction_WithDateSequences() { testExpressionTranslationWithContext( "reverse((xs:date('2022-01-01Z'),xs:date('2018-01-01Z'),xs:date('2020-01-01Z')))", - "ND-Root", "reverse((2022-01-01Z, 2018-01-01Z, 2020-01-01Z))"); + "ND-Root", "reverse([2022-01-01Z, 2018-01-01Z, 2020-01-01Z])"); } @Test void testReverseFunction_WithTimeSequences() { testExpressionTranslationWithContext( "reverse((xs:time('14:00:00Z'),xs:time('12:00:00Z'),xs:time('13:00:00Z')))", - "ND-Root", "reverse((14:00:00Z, 12:00:00Z, 13:00:00Z))"); + "ND-Root", "reverse([14:00:00Z, 12:00:00Z, 13:00:00Z])"); } @Test void testReverseFunction_WithDurationSequences() { testExpressionTranslationWithContext("reverse((xs:dayTimeDuration('P5D'),xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P7D')))", - "ND-Root", "reverse((P5D, P2D, P1W))"); + "ND-Root", "reverse([P5D, P2D, P1W])"); } @Test void testReverseFunction_WithBooleanSequences() { testExpressionTranslationWithContext("reverse((true(),false(),true()))", - "ND-Root", "reverse((TRUE, FALSE, TRUE))"); + "ND-Root", "reverse([TRUE, FALSE, TRUE])"); } @Test @@ -2533,26 +2533,26 @@ void testReverseFunction_WithRepeatableFieldReference() { @Test void testSubsequenceFunction_WithStringSequences() { testExpressionTranslationWithContext("subsequence(('a','b','c','d'), 2)", "ND-Root", - "subsequence(('a', 'b', 'c', 'd'), 2)"); + "subsequence(['a', 'b', 'c', 'd'], 2)"); } @Test void testSubsequenceFunction_WithStringSequences_AndLength() { testExpressionTranslationWithContext("subsequence(('a','b','c','d'), 2, 2)", "ND-Root", - "subsequence(('a', 'b', 'c', 'd'), 2, 2)"); + "subsequence(['a', 'b', 'c', 'd'], 2, 2)"); } @Test void testSubsequenceFunction_WithNumberSequences() { testExpressionTranslationWithContext("subsequence((10,20,30,40), 2, 2)", "ND-Root", - "subsequence((10, 20, 30, 40), 2, 2)"); + "subsequence([10, 20, 30, 40], 2, 2)"); } @Test void testSubsequenceFunction_WithDateSequences() { testExpressionTranslationWithContext( "subsequence((xs:date('2022-01-01Z'),xs:date('2023-01-01Z'),xs:date('2024-01-01Z')), 1, 2)", - "ND-Root", "subsequence((2022-01-01Z, 2023-01-01Z, 2024-01-01Z), 1, 2)"); + "ND-Root", "subsequence([2022-01-01Z, 2023-01-01Z, 2024-01-01Z], 1, 2)"); } @Test @@ -2576,40 +2576,40 @@ void testSubsequenceFunction_WithRepeatableFieldReference_AndLength() { @Test void testIndexOfFunction_WithStringSequences() { testExpressionTranslationWithContext("index-of(('a','b','c','b'), 'b')[1]", "ND-Root", - "index-of(('a', 'b', 'c', 'b'), 'b')"); + "index-of(['a', 'b', 'c', 'b'], 'b')"); } @Test void testIndexOfFunction_WithNumberSequences() { testExpressionTranslationWithContext("index-of((10,20,30,20), 20)[1]", "ND-Root", - "index-of((10, 20, 30, 20), 20)"); + "index-of([10, 20, 30, 20], 20)"); } @Test void testIndexOfFunction_WithDateSequences() { testExpressionTranslationWithContext( "index-of((xs:date('2022-01-01Z'),xs:date('2023-01-01Z'),xs:date('2022-01-01Z')), xs:date('2022-01-01Z'))[1]", - "ND-Root", "index-of((2022-01-01Z, 2023-01-01Z, 2022-01-01Z), 2022-01-01Z)"); + "ND-Root", "index-of([2022-01-01Z, 2023-01-01Z, 2022-01-01Z], 2022-01-01Z)"); } @Test void testIndexOfFunction_WithBooleanSequences() { testExpressionTranslationWithContext("index-of((true(),false(),true()), true())[1]", - "ND-Root", "index-of((TRUE, FALSE, TRUE), TRUE)"); + "ND-Root", "index-of([TRUE, FALSE, TRUE], TRUE)"); } @Test void testIndexOfFunction_WithTimeSequences() { testExpressionTranslationWithContext( "index-of((xs:time('14:00:00Z'),xs:time('12:00:00Z'),xs:time('14:00:00Z')), xs:time('14:00:00Z'))[1]", - "ND-Root", "index-of((14:00:00Z, 12:00:00Z, 14:00:00Z), 14:00:00Z)"); + "ND-Root", "index-of([14:00:00Z, 12:00:00Z, 14:00:00Z], 14:00:00Z)"); } @Test void testIndexOfFunction_WithDurationSequences() { testExpressionTranslationWithContext( "index-of((xs:dayTimeDuration('P5D'),xs:dayTimeDuration('P2D'),xs:dayTimeDuration('P5D')), xs:dayTimeDuration('P5D'))[1]", - "ND-Root", "index-of((P5D, P2D, P5D), P5D)"); + "ND-Root", "index-of([P5D, P2D, P5D], P5D)"); } @Test @@ -2627,41 +2627,41 @@ void testIndexOfFunction_WithRepeatableFieldReference() { void testSequenceEqualFunction_WithStringSequences() { testExpressionTranslationWithContext( "deep-equal(sort(('one','two')), sort(('two','three','four')))", "ND-Root", - "sequence-equal(('one', 'two'), ('two', 'three', 'four'))"); + "sequence-equal(['one', 'two'], ['two', 'three', 'four'])"); } @Test void testSequenceEqualFunction_WithNumberSequences() { testExpressionTranslationWithContext("deep-equal(sort((1,2,3)), sort((2,3,4)))", "ND-Root", - "sequence-equal((1, 2, 3), (2, 3, 4))"); + "sequence-equal([1, 2, 3], [2, 3, 4])"); } @Test void testSequenceEqualFunction_WithDateSequences() { testExpressionTranslationWithContext( "deep-equal(sort((xs:date('2018-01-01Z'),xs:date('2020-01-01Z'))), sort((xs:date('2018-01-01Z'),xs:date('2022-01-02Z'))))", - "ND-Root", "sequence-equal((2018-01-01Z, 2020-01-01Z), (2018-01-01Z, 2022-01-02Z))"); + "ND-Root", "sequence-equal([2018-01-01Z, 2020-01-01Z], [2018-01-01Z, 2022-01-02Z])"); } @Test void testSequenceEqualFunction_WithTimeSequences() { testExpressionTranslationWithContext( "deep-equal(sort((xs:time('12:00:00Z'),xs:time('13:00:00Z'))), sort((xs:time('12:00:00Z'),xs:time('14:00:00Z'))))", - "ND-Root", "sequence-equal((12:00:00Z, 13:00:00Z), (12:00:00Z, 14:00:00Z))"); + "ND-Root", "sequence-equal([12:00:00Z, 13:00:00Z], [12:00:00Z, 14:00:00Z])"); } @Test void testSequenceEqualFunction_WithBooleanSequences() { testExpressionTranslationWithContext( "deep-equal(sort((true(),false())), sort((false(),false())))", "ND-Root", - "sequence-equal((TRUE, FALSE), (FALSE, NEVER))"); + "sequence-equal([TRUE, FALSE], [FALSE, NEVER])"); } @Test void testSequenceEqualFunction_WithDurationSequences() { testExpressionTranslationWithContext( "deep-equal(sort((xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2Y'))), sort((xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P3Y'))))", - "ND-Root", "sequence-equal((P1Y, P2Y), (P1Y, P3Y))"); + "ND-Root", "sequence-equal([P1Y, P2Y], [P1Y, P3Y])"); } @Test @@ -2685,46 +2685,46 @@ void testSequenceEmptiness_WithNonRepeatableField() { @Test void testSequenceEmptiness_WithStringSequence() { testExpressionTranslationWithContext("empty(('a','b','c'))", "ND-Root", - "('a', 'b', 'c') is empty"); + "['a', 'b', 'c'] is empty"); } @Test void testSequenceEmptiness_WithStringSequence_Negated() { testExpressionTranslationWithContext("not(empty(('a','b','c')))", "ND-Root", - "('a', 'b', 'c') is not empty"); + "['a', 'b', 'c'] is not empty"); } @Test void testSequenceEmptiness_WithNumericSequence() { testExpressionTranslationWithContext("empty((1,2,3))", "ND-Root", - "(1, 2, 3) is empty"); + "[1, 2, 3] is empty"); } @Test void testSequenceEmptiness_WithBooleanSequence() { testExpressionTranslationWithContext("empty((true(),false()))", "ND-Root", - "(TRUE, FALSE) is empty"); + "[TRUE, FALSE] is empty"); } @Test void testSequenceEmptiness_WithDateSequence() { testExpressionTranslationWithContext( "empty((xs:date('2024-01-01Z'),xs:date('2024-12-31Z')))", "ND-Root", - "(2024-01-01Z, 2024-12-31Z) is empty"); + "[2024-01-01Z, 2024-12-31Z] is empty"); } @Test void testSequenceEmptiness_WithTimeSequence() { testExpressionTranslationWithContext( "empty((xs:time('12:00:00Z'),xs:time('13:00:00Z')))", "ND-Root", - "(12:00:00Z, 13:00:00Z) is empty"); + "[12:00:00Z, 13:00:00Z] is empty"); } @Test void testSequenceEmptiness_WithDurationSequence() { testExpressionTranslationWithContext( "empty((xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2Y')))", "ND-Root", - "(P1Y, P2Y) is empty"); + "[P1Y, P2Y] is empty"); } @Test @@ -2772,28 +2772,28 @@ void testSequenceDuplicates_WithNonRepeatableField() { void testSequenceDuplicates_WithStringSequence() { testExpressionTranslationWithContext( "not(count(('a','b','a')) = count(distinct-values(('a','b','a'))))", "ND-Root", - "('a', 'b', 'a') has duplicates"); + "['a', 'b', 'a'] has duplicates"); } @Test void testSequenceDuplicates_WithStringSequence_Negated() { testExpressionTranslationWithContext( "count(('a','b','c')) = count(distinct-values(('a','b','c')))", "ND-Root", - "('a', 'b', 'c') has no duplicates"); + "['a', 'b', 'c'] has no duplicates"); } @Test void testSequenceDuplicates_WithNumericSequence() { testExpressionTranslationWithContext( "not(count((1,2,3)) = count(distinct-values((1,2,3))))", "ND-Root", - "(1, 2, 3) has duplicates"); + "[1, 2, 3] has duplicates"); } @Test void testSequenceDuplicates_WithBooleanSequence() { testExpressionTranslationWithContext( "not(count((true(),false())) = count(distinct-values((true(),false()))))", "ND-Root", - "(TRUE, FALSE) has duplicates"); + "[TRUE, FALSE] has duplicates"); } @Test @@ -2801,7 +2801,7 @@ void testSequenceDuplicates_WithDateSequence() { testExpressionTranslationWithContext( "not(count((xs:date('2024-01-01Z'),xs:date('2024-12-31Z'))) = count(distinct-values((xs:date('2024-01-01Z'),xs:date('2024-12-31Z')))))", "ND-Root", - "(2024-01-01Z, 2024-12-31Z) has duplicates"); + "[2024-01-01Z, 2024-12-31Z] has duplicates"); } @Test @@ -2809,7 +2809,7 @@ void testSequenceDuplicates_WithTimeSequence() { testExpressionTranslationWithContext( "not(count((xs:time('12:00:00Z'),xs:time('13:00:00Z'))) = count(distinct-values((xs:time('12:00:00Z'),xs:time('13:00:00Z')))))", "ND-Root", - "(12:00:00Z, 13:00:00Z) has duplicates"); + "[12:00:00Z, 13:00:00Z] has duplicates"); } @Test @@ -2817,7 +2817,7 @@ void testSequenceDuplicates_WithDurationSequence() { testExpressionTranslationWithContext( "not(count((xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2Y'))) = count(distinct-values((xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2Y')))))", "ND-Root", - "(P1Y, P2Y) has duplicates"); + "[P1Y, P2Y] has duplicates"); } @Test @@ -2883,37 +2883,37 @@ void testParameterizedExpression_WithDurationParameter() { @Test void testParameterizedExpression_WithTextSequenceParameter() { testExpressionTranslation("count(('a','b','c'))", - "{ND-Root, text*:$items} ${count($items)}", "('a', 'b', 'c')"); + "{ND-Root, text*:$items} ${count($items)}", "['a', 'b', 'c']"); } @Test void testParameterizedExpression_WithNumericSequenceParameter() { testExpressionTranslation("count((1,2,3))", - "{ND-Root, number*:$items} ${count($items)}", "(1, 2, 3)"); + "{ND-Root, number*:$items} ${count($items)}", "[1, 2, 3]"); } @Test void testParameterizedExpression_WithBooleanSequenceParameter() { testExpressionTranslation("count((true(),false(),true()))", - "{ND-Root, indicator*:$items} ${count($items)}", "(TRUE, FALSE, ALWAYS)"); + "{ND-Root, indicator*:$items} ${count($items)}", "[TRUE, FALSE, ALWAYS]"); } @Test void testParameterizedExpression_WithDateSequenceParameter() { testExpressionTranslation("count((xs:date('2024-01-01Z'),xs:date('2024-12-31Z')))", - "{ND-Root, date*:$items} ${count($items)}", "(2024-01-01Z, 2024-12-31Z)"); + "{ND-Root, date*:$items} ${count($items)}", "[2024-01-01Z, 2024-12-31Z]"); } @Test void testParameterizedExpression_WithTimeSequenceParameter() { testExpressionTranslation("count((xs:time('10:00:00Z'),xs:time('18:00:00Z')))", - "{ND-Root, time*:$items} ${count($items)}", "(10:00:00Z, 18:00:00Z)"); + "{ND-Root, time*:$items} ${count($items)}", "[10:00:00Z, 18:00:00Z]"); } @Test void testParameterizedExpression_WithDurationSequenceParameter() { testExpressionTranslation("count((xs:yearMonthDuration('P1Y'),xs:yearMonthDuration('P2M')))", - "{ND-Root, measure*:$items} ${count($items)}", "(P1Y, P2M)"); + "{ND-Root, measure*:$items} ${count($items)}", "[P1Y, P2M]"); } // #endregion: Compare sequences @@ -2956,7 +2956,7 @@ void testIndexer_WithRepeatableFieldAndPredicate() { @Test void testIndexer_WithTextSequence() { - testExpressionTranslationWithContext("('a','b','c')[1]", "ND-Root", "('a', 'b','c')[1]"); + testExpressionTranslationWithContext("('a','b','c')[1]", "ND-Root", "['a', 'b','c'][1]"); } // #endregion: Indexers diff --git a/src/test/java/eu/europa/ted/efx/sdk2/EfxTemplateTranslatorV2Test.java b/src/test/java/eu/europa/ted/efx/sdk2/EfxTemplateTranslatorV2Test.java index 346fd5fe..ba0d8ad0 100644 --- a/src/test/java/eu/europa/ted/efx/sdk2/EfxTemplateTranslatorV2Test.java +++ b/src/test/java/eu/europa/ted/efx/sdk2/EfxTemplateTranslatorV2Test.java @@ -515,7 +515,7 @@ void testDisplayTemplate_WithTextSequenceVariable() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let text*:$items = ('a', 'b', 'c');", + "let text*:$items = ['a', 'b', 'c'];", "display count: ${count($items)};"))); } @@ -530,7 +530,7 @@ void testDisplayTemplate_WithNumericSequenceVariable() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let number*:$nums = (1, 2, 3);", + "let number*:$nums = [1, 2, 3];", "display count: ${count($nums)};"))); } @@ -545,7 +545,7 @@ void testDisplayTemplate_WithBooleanSequenceVariable() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let indicator*:$flags = (TRUE, FALSE);", + "let indicator*:$flags = [TRUE, FALSE];", "display count: ${count($flags)};"))); } @@ -560,7 +560,7 @@ void testDisplayTemplate_WithDateSequenceVariable() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let date*:$dates = (2024-01-01Z, 2024-12-31Z);", + "let date*:$dates = [2024-01-01Z, 2024-12-31Z];", "display count: ${count($dates)};"))); } @@ -575,7 +575,7 @@ void testDisplayTemplate_WithTimeSequenceVariable() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let time*:$times = (10:00:00Z, 18:00:00Z);", + "let time*:$times = [10:00:00Z, 18:00:00Z];", "display count: ${count($times)};"))); } @@ -590,7 +590,7 @@ void testDisplayTemplate_WithDurationSequenceVariable() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let measure*:$durs = (P1Y, P2M);", + "let measure*:$durs = [P1Y, P2M];", "display count: ${count($durs)};"))); } @@ -609,7 +609,7 @@ void testDisplayTemplate_WithTextSequenceFunction() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let text*:?getItems() = ('a', 'b', 'c');", + "let text*:?getItems() = ['a', 'b', 'c'];", "display count: ${count(?getItems())};"))); } @@ -624,7 +624,7 @@ void testDisplayTemplate_WithNumericSequenceFunction() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let number*:?getNumbers() = (1, 2, 3);", + "let number*:?getNumbers() = [1, 2, 3];", "display count: ${count(?getNumbers())};"))); } @@ -639,7 +639,7 @@ void testDisplayTemplate_WithBooleanSequenceFunction() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let indicator*:?getFlags() = (TRUE, FALSE);", + "let indicator*:?getFlags() = [TRUE, FALSE];", "display count: ${count(?getFlags())};"))); } @@ -654,7 +654,7 @@ void testDisplayTemplate_WithDateSequenceFunction() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let date*:?getDates() = (2024-01-01Z, 2024-12-31Z);", + "let date*:?getDates() = [2024-01-01Z, 2024-12-31Z];", "display count: ${count(?getDates())};"))); } @@ -669,7 +669,7 @@ void testDisplayTemplate_WithTimeSequenceFunction() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let time*:?getTimes() = (10:00:00Z, 18:00:00Z);", + "let time*:?getTimes() = [10:00:00Z, 18:00:00Z];", "display count: ${count(?getTimes())};"))); } @@ -684,7 +684,7 @@ void testDisplayTemplate_WithDurationSequenceFunction() { "MAIN:", "for-each(/*).call(body01())"), translateTemplate(lines( - "let measure*:?getDurations() = (P1Y, P2M);", + "let measure*:?getDurations() = [P1Y, P2M];", "display count: ${count(?getDurations())};"))); } @@ -1169,7 +1169,7 @@ void testLabelBlock_ComputedLabelReference() { "let body01() -> { label(string-join(('field','|','name','|','BT-00-Text'), ', ')) }", "MAIN:", "for-each(/*/PathNode/TextField).call(body01())"), - translateTemplate("{BT-00-Text} #{${string-join(('field', '|', 'name', '|', 'BT-00-Text'), ', ')}}")); + translateTemplate("{BT-00-Text} #{${string-join(['field', '|', 'name', '|', 'BT-00-Text'], ', ')}}")); } @Test @@ -1906,7 +1906,7 @@ void testExpressionBlock_LiteralNumericSequence() { "let body01() -> { text('Values: ')eval((1,2,3)) }", "MAIN:", "for-each(/*).call(body01())"), - translateTemplate("{ND-Root} Values: ${(1,2,3)}")); + translateTemplate("{ND-Root} Values: ${[1,2,3]}")); } @Test @@ -1917,7 +1917,7 @@ void testExpressionBlock_MixedSequenceWithField() { "let body01() -> { text('Values: ')eval((1,2,PathNode/NumberField/number())) }", "MAIN:", "for-each(/*).call(body01())"), - translateTemplate("{ND-Root} Values: ${(1,2,BT-00-Number)}")); + translateTemplate("{ND-Root} Values: ${[1,2,BT-00-Number]}")); } // #endregion Repeatable Fields in Expression Blocks ------------------------- diff --git a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testOutput_FromSampleRulesFile/input.efx b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testOutput_FromSampleRulesFile/input.efx index 498c79f0..8854459d 100644 --- a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testOutput_FromSampleRulesFile/input.efx +++ b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testOutput_FromSampleRulesFile/input.efx @@ -76,6 +76,6 @@ FOR BT-00-Indicator IN *; // Rule with code check WITH ND-Root -ASSERT BT-00-Code in ("code1", "code2", "code3") +ASSERT BT-00-Code in ["code1", "code2", "code3"] AS ERROR R-S9L-R5K FOR BT-00-Code IN *; diff --git a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_BooleanSequence_GlobalLevel/input.efx b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_BooleanSequence_GlobalLevel/input.efx index 677d8d65..8fd5533c 100644 --- a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_BooleanSequence_GlobalLevel/input.efx +++ b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_BooleanSequence_GlobalLevel/input.efx @@ -1,4 +1,4 @@ -LET indicator* : $flags = (TRUE, FALSE, TRUE); +LET indicator* : $flags = [TRUE, FALSE, TRUE]; ---- STAGE 1a ---- diff --git a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_DateSequence_GlobalLevel/input.efx b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_DateSequence_GlobalLevel/input.efx index d2382c4e..c6838f87 100644 --- a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_DateSequence_GlobalLevel/input.efx +++ b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_DateSequence_GlobalLevel/input.efx @@ -1,4 +1,4 @@ -LET date* : $dates = (2024-01-01Z, 2024-06-01Z); +LET date* : $dates = [2024-01-01Z, 2024-06-01Z]; ---- STAGE 1a ---- diff --git a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_DurationSequence_GlobalLevel/input.efx b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_DurationSequence_GlobalLevel/input.efx index 6d911e90..5ab74e28 100644 --- a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_DurationSequence_GlobalLevel/input.efx +++ b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_DurationSequence_GlobalLevel/input.efx @@ -1,4 +1,4 @@ -LET measure* : $durations = (P1D, P2D); +LET measure* : $durations = [P1D, P2D]; ---- STAGE 1a ---- diff --git a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_NumericSequence_GlobalLevel/input.efx b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_NumericSequence_GlobalLevel/input.efx index c29f5f54..deb73df3 100644 --- a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_NumericSequence_GlobalLevel/input.efx +++ b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_NumericSequence_GlobalLevel/input.efx @@ -1,4 +1,4 @@ -LET number* : $numbers = (1, 2, 3); +LET number* : $numbers = [1, 2, 3]; ---- STAGE 1a ---- diff --git a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_TextSequence_GlobalLevel/input.efx b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_TextSequence_GlobalLevel/input.efx index bea6cfac..6af42a16 100644 --- a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_TextSequence_GlobalLevel/input.efx +++ b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_TextSequence_GlobalLevel/input.efx @@ -1,4 +1,4 @@ -LET text* : $languages = ('EN', 'FR', 'DE'); +LET text* : $languages = ['EN', 'FR', 'DE']; ---- STAGE 1a ---- diff --git a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_TimeSequence_GlobalLevel/input.efx b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_TimeSequence_GlobalLevel/input.efx index 97a77966..7082ee74 100644 --- a/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_TimeSequence_GlobalLevel/input.efx +++ b/src/test/resources/eu/europa/ted/efx/sdk2/EfxRulesTranslatorV2Test/testVariable_TimeSequence_GlobalLevel/input.efx @@ -1,4 +1,4 @@ -LET time* : $times = (09:00:00Z, 17:00:00Z); +LET time* : $times = [09:00:00Z, 17:00:00Z]; ---- STAGE 1a ---- diff --git a/src/test/resources/json/sdk2-fields.json b/src/test/resources/json/sdk2-fields.json index 526647c8..9dcf766d 100644 --- a/src/test/resources/json/sdk2-fields.json +++ b/src/test/resources/json/sdk2-fields.json @@ -352,6 +352,61 @@ "value": true } }, + { + "id": "BT-00-Repeatable-Number", + "alias": "repeatableNumberField", + "type": "number", + "parentNodeId": "ND-Root", + "xpathAbsolute": "/*/PathNode/RepeatableNumberField", + "xpathRelative": "PathNode/RepeatableNumberField", + "repeatable": { + "value": true + } + }, + { + "id": "BT-00-Repeatable-Indicator", + "alias": "repeatableIndicatorField", + "type": "indicator", + "parentNodeId": "ND-Root", + "xpathAbsolute": "/*/PathNode/RepeatableIndicatorField", + "xpathRelative": "PathNode/RepeatableIndicatorField", + "repeatable": { + "value": true + } + }, + { + "id": "BT-00-Repeatable-Date", + "alias": "repeatableDateField", + "type": "date", + "parentNodeId": "ND-Root", + "xpathAbsolute": "/*/PathNode/RepeatableDateField", + "xpathRelative": "PathNode/RepeatableDateField", + "repeatable": { + "value": true + } + }, + { + "id": "BT-00-Repeatable-Time", + "alias": "repeatableTimeField", + "type": "time", + "parentNodeId": "ND-Root", + "xpathAbsolute": "/*/PathNode/RepeatableTimeField", + "xpathRelative": "PathNode/RepeatableTimeField", + "repeatable": { + "value": true + } + }, + { + "id": "BT-00-Repeatable-Duration", + "alias": "repeatableDurationField", + "type": "duration", + "parentNodeId": "ND-Root", + "xpathAbsolute": "/*/PathNode/RepeatableDurationField", + "xpathRelative": "PathNode/RepeatableDurationField", + "repeatable": { + "value": true + } + }, { "id": "BT-00-Text-In-Repeatable-Node", "alias": "textInRepeatableNode",