Skip to content

Commit

Permalink
Merge pull request #1163 from RumbleDB/TestFix
Browse files Browse the repository at this point in the history
Test fix
  • Loading branch information
ghislainfourny authored Feb 1, 2022
2 parents 2b3b8f9 + 24a811d commit 1d3a3d6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
(:JIQS: ShouldRun; Output="({ "$guess" : "Bulgarian", "$i" : [ { "guess" : "Bulgarian", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ] }, { "$guess" : "Arabic", "$i" : [ { "guess" : "Arabic", "choices" : [ "Arabic", "Cantonese", "Maltese", "Samoan" ] }, { "guess" : "Arabic", "choices" : [ "Albanian", "Arabic", "Czech", "Dutch" ] } ] })" :)
(:JIQS: ShouldRun; Output="({ "$guess" : "Arabic", "$i" : [ { "guess" : "Arabic", "choices" : [ "Arabic", "Cantonese", "Maltese", "Samoan" ] }, { "guess" : "Arabic", "choices" : [ "Albanian", "Arabic", "Czech", "Dutch" ] } ] }, { "$guess" : "Bulgarian", "$i" : [ { "guess" : "Bulgarian", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ] })" :)
for $i in parallelize((
{"guess": "Arabic", "choices": ["Arabic", "Cantonese", "Maltese", "Samoan"]},
{"guess": "Arabic", "choices": ["Albanian", "Arabic", "Czech", "Dutch"]},
{"guess": "Bulgarian", "choices": ["Albanian", "Bulgarian", "Russian", "Ukrainian"]},
{"guess": "Bulgarian", "choices": ["Arabic", "Bulgarian", "Hebrew", "Spanish"]}))
let $guess := $i.guess
group by $guess
order by $guess
return {"$guess": $guess, "$i": $i}

(: test with no null or empty entries - grouping variable pre-defined with let :)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(:JIQS: ShouldRun; Output="({ "$guess" : "Arabic", "$target" : null, "$country" : null, "$i" : [ { "guess" : "Arabic", "choices" : [ "Arabic", "Cantonese", "Maltese", "Samoan" ] }, { "guess" : "Arabic", "choices" : [ "Albanian", "Arabic", "Czech", "Dutch" ] } ] }, { "$guess" : "Bulgarian", "$target" : "Albanian", "$country" : "AU", "$i" : [ { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ] }, { "$guess" : "Arabic", "$target" : null, "$country" : null, "$i" : { "guess" : "Arabic", "country" : null, "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } }, { "$guess" : "Arabic", "$target" : null, "$country" : "IN", "$i" : { "guess" : "Arabic", "country" : "IN", "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } }, { "$guess" : "Slovenian", "$target" : "Norwegian", "$country" : "AU", "$i" : { "guess" : "Slovenian", "target" : "Norwegian", "country" : "AU", "choices" : [ "Dinka", "Nepali", "Norwegian", "Slovenian" ] } }, { "$guess" : "Bulgarian", "$target" : null, "$country" : "AU", "$i" : [ { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ] })" :)
(:JIQS: ShouldRun; Output="({ "$guess" : "Arabic", "$target" : null, "$country" : null, "$i" : [ { "guess" : "Arabic", "choices" : [ "Arabic", "Cantonese", "Maltese", "Samoan" ] }, { "guess" : "Arabic", "choices" : [ "Albanian", "Arabic", "Czech", "Dutch" ] } ] }, { "$guess" : "Arabic", "$target" : null, "$country" : null, "$i" : { "guess" : "Arabic", "country" : null, "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } }, { "$guess" : "Arabic", "$target" : null, "$country" : "IN", "$i" : { "guess" : "Arabic", "country" : "IN", "choices" : [ "Arabic", "Greek", "Hebrew", "Spanish" ] } }, { "$guess" : "Bulgarian", "$target" : null, "$country" : "AU", "$i" : [ { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : null, "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ] }, { "$guess" : "Bulgarian", "$target" : "Albanian", "$country" : "AU", "$i" : [ { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Albanian", "Bulgarian", "Russian", "Ukrainian" ] }, { "guess" : "Bulgarian", "target" : "Albanian", "country" : "AU", "choices" : [ "Arabic", "Bulgarian", "Hebrew", "Spanish" ] } ] }, { "$guess" : "Slovenian", "$target" : "Norwegian", "$country" : "AU", "$i" : { "guess" : "Slovenian", "target" : "Norwegian", "country" : "AU", "choices" : [ "Dinka", "Nepali", "Norwegian", "Slovenian" ] } })" :)
for $i in parallelize((
{"guess": "Slovenian", "target": "Norwegian", "country": "AU", "choices": ["Dinka", "Nepali", "Norwegian", "Slovenian"]},
{"guess": "Arabic", "choices": ["Arabic", "Cantonese", "Maltese", "Samoan"]},
Expand All @@ -11,6 +11,7 @@ for $i in parallelize((
{"guess": "Bulgarian", "target": null, "country": "AU", "choices": ["Arabic", "Bulgarian", "Hebrew", "Spanish"]}))
let $guess := $i.guess, $target := $i.target, $country := $i.country
group by $guess, $target, $country
order by $guess, $target, $country
return {"$guess": $guess, "$target": $target, "$country": $country, "$i": $i}

(: complex test with nulls and empty sequences - grouping variable pre-defined with let:)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(:JIQS: ShouldRun; Output="(Czech, Serbian, Russian)" :)
(:JIQS: ShouldRun; Output="(Czech, Russian, Serbian)" :)
for $i in json-file("../../../queries/conf-ex.json", 10)
group by $target := $i.target
order by $target
return $target

(: variables defined in groupby are accessible all the way to and including the return clause:)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(:JIQS: ShouldRun; Output="(2004-04-12, 2004-04-12-05:00, -0045-01-01, 2004-04-12+14:00, 12004-04-12Z)" :)
(:JIQS: ShouldRun; Output="(-0045-01-01, 2004-04-12+14:00, 2004-04-12, 2004-04-12-05:00, 12004-04-12Z)" :)
for $j as date in parallelize((date("2004-04-12"), date("2004-04-12-05:00"), date("2004-04-12Z"), date("2004-04-12+14:00"), date("-0045-01-01"), date("12004-04-12Z"), date(())))
group by $j
order by $j
return $j
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(:JIQS: ShouldRun; Output="(2004-04-12T13:20:00+14:00, 2004-04-12T13:20:15.500, 2004-04-12T13:20:00, 2001-12-13T00:00:00, 2004-04-12T13:20:00-05:00, 2000-12-12T12:12:12Z)" :)
(:JIQS: ShouldRun; Output="(2000-12-12T12:12:12Z, 2001-12-13T00:00:00, 2004-04-12T13:20:00+14:00, 2004-04-12T13:20:00, 2004-04-12T13:20:15.500, 2004-04-12T13:20:00-05:00)" :)
for $j as dateTime in parallelize((dateTime("2004-04-12T13:20:00"), dateTime("2000-12-12T12:12:12Z"), dateTime("2004-04-12T13:20:15.5"), dateTime("2004-04-12T13:20:00-05:00"), dateTime("2004-04-12T13:20:00Z"), dateTime("2004-04-12T13:20:00+14:00"), dateTime("2001-12-12T24:00:00"), dateTime(())))
group by $j
order by $j
return $j
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(:JIQS: ShouldRun; Output="(AABB, 0123456789ABCDEF)" :)
(:JIQS: ShouldRun; Output="(0123456789ABCDEF, AABB)" :)
for $j as hexBinary in parallelize((hexBinary("0123456789abcdef"), hexBinary("AaBb"), hexBinary("aAbB"), hexBinary(())))
group by $j
order by string($j)
return $j
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(:JIQS: ShouldRun; Output="(12:12:12Z, 13:20:00-05:00, 13:20:00, 13:20:30.555, 00:00:00)" :)
(:JIQS: ShouldRun; Output="(00:00:00, 12:12:12Z, 13:20:00, 13:20:30.555, 13:20:00-05:00)" :)
for $j as time in parallelize((time("12:12:12Z"), time("13:20:00"), time("13:20:30.5555"), time("13:20:00-05:00"), time("13:20:00Z"), time("00:00:00"), time("24:00:00"), time(())))
group by $j
order by $j
return $j
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(:JIQS: ShouldRun; Output="({ "k" : 1, "i" : 1 }, { "k" : 0, "i" : 1 }, { "k" : 1, "i" : 2 }, { "k" : 0, "i" : 2 })" :)
(:JIQS: ShouldRun; Output="({ "k" : 0, "i" : 1 }, { "k" : 1, "i" : 1 }, { "k" : 0, "i" : 2 }, { "k" : 1, "i" : 2 })" :)

for $i in 1 to 2
return
for $j in parallelize(1 to 4)
let $k := $j mod 2
group by $k
order by $k
return { "k" : $k, "i" : $i }

0 comments on commit 1d3a3d6

Please sign in to comment.