Skip to content

Commit 6c2af8c

Browse files
Minor cleanup of #2595 test code (#2596)
* fix race condition in `MapMerge` duplicate handling under `fork-join` * test cleanup
1 parent 691873e commit 6c2af8c

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

basex-core/src/test/java/org/basex/query/func/XQueryModuleTest.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,23 @@ public final class XQueryModuleTest extends SandboxTest {
153153
query(func.args(" (true#0, false#0)", " { 'parallel': <_>1</_> }"), "true\nfalse");
154154

155155
// MapMerge mutable instance variables
156-
query("xquery:fork-join(\r\n"
157-
+ " for $t in 1 to 100\r\n"
158-
+ " return function() {\r\n"
159-
+ " for $i in 1 to 10\r\n"
160-
+ " let $v := map:build(\r\n"
161-
+ " ($i, $i),\r\n"
162-
+ " (),\r\n"
163-
+ " (),\r\n"
164-
+ " { 'duplicates': function($x, $y) { $x * $y } }\r\n"
165-
+ " )($i)\r\n"
166-
+ " return\r\n"
167-
+ " if($v eq $i * $i) then\r\n"
168-
+ " $v\r\n"
169-
+ " else\r\n"
170-
+ " error(xs:QName('err:FAIL'), `{$i}: expected {$i * $i}, but got {$v}`)\r\n"
171-
+ " }\r\n"
172-
+ ")\r\n"
173-
+ "=> count()", 1000);
156+
query(func.args(
157+
" for $t in 1 to 100\n"
158+
+ " return function() {\n"
159+
+ " for $i in 1 to 10\n"
160+
+ " let $v := map:build(\n"
161+
+ " ($i, $i),\n"
162+
+ " (),\n"
163+
+ " (),\n"
164+
+ " { 'duplicates': function($x, $y) { $x * $y } }\n"
165+
+ " )($i)\n"
166+
+ " return\n"
167+
+ " if($v eq $i * $i) then\n"
168+
+ " $v\n"
169+
+ " else\n"
170+
+ " error(xs:QName('err:FAIL'), `{$i}: expected {$i * $i}, but got {$v}`)\n"
171+
+ " }")
172+
+ " => count()", 1000);
174173

175174
// optimizations
176175
check(func.args(" ()"), "", empty());

0 commit comments

Comments
 (0)