← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/deterministic-keys1g into lp:zorba

 

Till Westmann has proposed merging lp:~zorba-coders/zorba/deterministic-keys1g into lp:zorba.

Requested reviews:
  David Graf (davidagraf)
  Ghislain Fourny (gislenius)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/deterministic-keys1g/+merge/122729

ensure deterministic test results for keys of index on unordered collection by sorting
-- 
https://code.launchpad.net/~zorba-coders/zorba/deterministic-keys1g/+merge/122729
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'test/rbkt/ExpQueryResults/zorba/index/keys1g.xml.res'
--- test/rbkt/ExpQueryResults/zorba/index/keys1g.xml.res	2012-07-13 21:13:30 +0000
+++ test/rbkt/ExpQueryResults/zorba/index/keys1g.xml.res	2012-09-04 17:54:21 +0000
@@ -1,32 +1,32 @@
-<keys>
+<keys count="10">
+  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
+    <attribute type="xs:long" value="0"></attribute>
+  </key>
+  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
+    <attribute type="xs:long" value="2"></attribute>
+  </key>
+  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
+    <attribute type="xs:long" value="4"></attribute>
+  </key>
+  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
+    <attribute type="xs:long" value="6"></attribute>
+  </key>
+  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
+    <attribute type="xs:long" value="8"></attribute>
+  </key>
   <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
     <attribute type="xs:string" value="2"></attribute>
   </key>
   <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
+    <attribute type="xs:string" value="4"></attribute>
+  </key>
+  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
     <attribute type="xs:string" value="6"></attribute>
   </key>
   <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
-    <attribute type="xs:string" value="4"></attribute>
+    <attribute type="xs:string" value="8"></attribute>
   </key>
   <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
     <attribute type="xs:string" value="10"></attribute>
   </key>
-  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
-    <attribute type="xs:string" value="8"></attribute>
-  </key>
-  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
-    <attribute type="xs:long" value="0"></attribute>
-  </key>
-  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
-    <attribute type="xs:long" value="6"></attribute>
-  </key>
-  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
-    <attribute type="xs:long" value="2"></attribute>
-  </key>
-  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
-    <attribute type="xs:long" value="8"></attribute>
-  </key>
-  <key xmlns="http://www.zorba-xquery.com/modules/store/static/indexes/dml";>
-    <attribute type="xs:long" value="4"></attribute>
-  </key>
 </keys>

=== modified file 'test/rbkt/Queries/zorba/index/keys1g.xq'
--- test/rbkt/Queries/zorba/index/keys1g.xq	2012-07-13 21:13:30 +0000
+++ test/rbkt/Queries/zorba/index/keys1g.xq	2012-09-04 17:54:21 +0000
@@ -17,10 +17,12 @@
       <foo id="{$i - 1}" string="true"/>
   );
 
-let $keys := index_dml:keys(xs:QName("keys-lib:FooIdx-general"))
-let $attr := $keys[1]/self::*:key/*:attribute/@*:value
+let $keys :=
+  for $key in index_dml:keys(xs:QName("keys-lib:FooIdx-general"))
+  let $attr := $key/self::*:key/*:attribute
+  order by xs:string($attr/@*:type), xs:long($attr/@*:value)
+  return $key
 return
-  <keys>{
+  <keys count="{ count($keys) }">{
     $keys
   }</keys>
-


Follow ups