Test cases from XPath-PT, script.
authorLucca Hirschi <lucca.hirschi@gmail.com>
Mon, 16 Jul 2012 12:38:00 +0000 (14:38 +0200)
committerLucca Hirschi <lucca.hirschi@gmail.com>
Mon, 16 Jul 2012 12:46:44 +0000 (14:46 +0200)
80 files changed:
bench_test [new file with mode: 0755]
src/solve.ml
tests/docs/XPath-PT.xml [new file with mode: 0644]
tests/queries/XPath-PT/A1.xpl [new file with mode: 0644]
tests/queries/XPath-PT/A1.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/A2.xpl [new file with mode: 0644]
tests/queries/XPath-PT/A2.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/A3.xpl [new file with mode: 0644]
tests/queries/XPath-PT/A3.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/A4.xpl [new file with mode: 0644]
tests/queries/XPath-PT/A4.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/A5.xpl [new file with mode: 0644]
tests/queries/XPath-PT/A5.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/A6.xpl [new file with mode: 0644]
tests/queries/XPath-PT/A6.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/A7.xpl [new file with mode: 0644]
tests/queries/XPath-PT/A7.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/A8.xpl [new file with mode: 0644]
tests/queries/XPath-PT/A8.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B1.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B1.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B10.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B10.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B2.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B2.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B3.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B3.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B4.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B4.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B5.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B5.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B6.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B6.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B7.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B7.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B8.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B8.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/B9.xpl [new file with mode: 0644]
tests/queries/XPath-PT/B9.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/C1.xpl [new file with mode: 0644]
tests/queries/XPath-PT/C1.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/C2.xpl [new file with mode: 0644]
tests/queries/XPath-PT/C2.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/C3.xpl [new file with mode: 0644]
tests/queries/XPath-PT/C3.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/C4.xpl [new file with mode: 0644]
tests/queries/XPath-PT/C4.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/C5.xpl [new file with mode: 0644]
tests/queries/XPath-PT/C5.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/C6.xpl [new file with mode: 0644]
tests/queries/XPath-PT/C6.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/C7.xpl [new file with mode: 0644]
tests/queries/XPath-PT/C7.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/D1.xpl [new file with mode: 0644]
tests/queries/XPath-PT/D1.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/D2.xpl [new file with mode: 0644]
tests/queries/XPath-PT/D2.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/D3.xpl [new file with mode: 0644]
tests/queries/XPath-PT/D3.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/D4.xpl [new file with mode: 0644]
tests/queries/XPath-PT/D4.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/D5.xpl [new file with mode: 0644]
tests/queries/XPath-PT/D5.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/E1.xpl [new file with mode: 0644]
tests/queries/XPath-PT/E1.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/E2.xpl [new file with mode: 0644]
tests/queries/XPath-PT/E2.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/E3.xpl [new file with mode: 0644]
tests/queries/XPath-PT/E3.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/E4.xpl [new file with mode: 0644]
tests/queries/XPath-PT/E4.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/E5.xpl [new file with mode: 0644]
tests/queries/XPath-PT/E5.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/E6.xpl [new file with mode: 0644]
tests/queries/XPath-PT/E6.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/E7.xpl [new file with mode: 0644]
tests/queries/XPath-PT/E7.xpl.swr [new file with mode: 0644]
tests/queries/XPath-PT/E8.xpl [new file with mode: 0644]
tests/queries/XPath-PT/E8.xpl.swr [new file with mode: 0644]
tests/queries/test.qu [new file with mode: 0644]

diff --git a/bench_test b/bench_test
new file mode 100755 (executable)
index 0000000..82104b2
--- /dev/null
@@ -0,0 +1,10 @@
+echo \#\#\# DOC :
+cat ./tests/docs/XPath-PT.xml
+echo 
+for quer in ./tests/queries/XPath-PT/*.xpl ; do
+    echo $quer:
+    cat "$quer"
+    ./solve.native ./tests/docs/XPath-PT.xml -f "$quer"
+    cat "$quer".swr
+    echo 
+done
\ No newline at end of file
index d898bab..6e25db2 100644 (file)
@@ -15,7 +15,8 @@
 
 
 (** use: [./test xml_file -f XPath_queries_file]
-    one query per line [XPath_querie_file]
+    one query per line [XPath_querie_file], output
+    a solution per line.
 *)
 
 open Format
@@ -24,7 +25,6 @@ let doc () =
   let fd = open_in Sys.argv.(1) in
   let d = Tree.load_xml_file fd in
   close_in fd;
-  fprintf err_formatter "Parse Tree OK ! ";
   d
 
 
@@ -32,46 +32,47 @@ let query () =
   let arg2 = Sys.argv.(2) in
   if arg2 = "-f"
   then  let fq = open_in Sys.argv.(3) in
-        let rec list_qu fq list =
-          try
-            (match XPath.parse_file fq with
-              | q -> list_qu fq (q::list)
-              | _ -> list)
+        let rec list_qu fq list =          
+          try let q =  XPath.parse_file fq in
+              list_qu fq (q::list)
           with _ -> list in
         let list = list_qu fq [] in
         close_in fq;
-        fprintf err_formatter "Parse query OK ! ";
         list
-  else failwith "Use -f"
-
-let build_asta query =
-  let asta = Compil.trans query in
-  fprintf err_formatter "Compil OK ! ";
-  asta
+  else failwith "Use ./test xml_file -f XPath_queries_file"
 
 let compute_run doc query = 
   let run = Run.compute doc query in
-  fprintf err_formatter "Run OK ! \n";
   run
 
 let () =
+  let flag  = Array.length Sys.argv = 5 in
   Format.pp_set_margin err_formatter 80;
   let doc = doc () in
-  output_string stderr "##### Doc with positions #####\n";
-  Tree.print_xml_preorder stderr doc (Tree.root doc);
   let queries = query () in
+  let rec print_selec fmt l = match l with
+    | [x] -> fprintf fmt "%s" (string_of_int x)
+    | x :: tl -> fprintf fmt "%s" ((string_of_int x)^"; ");print_selec fmt tl
+    | [] -> fprintf fmt "%s" "ø" in
   let rec solve_queries = function
     | [] -> ()
     | query :: tl ->
-      let asta = build_asta query in
+      let asta = Compil.trans query in
       let selected_nodes = Run.selected_nodes doc asta in
-      fprintf err_formatter "Query: %a\n"
-        XPath.Ast.print query;
-      let rec print_selec fmt l = match l with
-        | [x] -> fprintf fmt "%s" (string_of_int x)
-        | x :: tl -> fprintf fmt "%s" ((string_of_int x)^"; ");print_selec fmt tl
-        | [] -> fprintf fmt "%s" "ø" in
-      fprintf err_formatter "@.@.  # Selected nodes: {%a}@."
-        print_selec selected_nodes in
+      let run = compute_run doc asta in
+      if flag
+      then
+        fprintf err_formatter "  ### Query: %a"
+          XPath.Ast.print query
+      else ();
+      fprintf err_formatter "@.  ### Selected nodes: {%a}@."
+        print_selec selected_nodes;
+      if flag
+      then begin
+        Asta.print err_formatter asta;
+        Run.print err_formatter run;
+      end
+      else ();
+      solve_queries tl in
   solve_queries queries;
   exit 0
diff --git a/tests/docs/XPath-PT.xml b/tests/docs/XPath-PT.xml
new file mode 100644 (file)
index 0000000..0c21bc6
--- /dev/null
@@ -0,0 +1,34 @@
+<X>
+  <b>
+    <a>
+      <c>
+        <e>
+          <f>
+            <g>
+              <b>
+                <g/>
+              </b>
+            </g>
+          </f>
+          <e/>
+        </e>
+      </c>
+    </a>
+  </b>
+  <a>
+    <c>
+      <e>
+        <f/>
+      </e>
+      <f>
+        <X>
+          <g/>
+          <b>
+            <g/>
+          </b>
+        </X>
+        <e/>
+      </f>
+    </c>
+  </a>
+</X>
diff --git a/tests/queries/XPath-PT/A1.xpl b/tests/queries/XPath-PT/A1.xpl
new file mode 100644 (file)
index 0000000..1829e5c
--- /dev/null
@@ -0,0 +1 @@
+/site/closed_auctions/closed_auction/annotation/description/text/keyword
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/A1.xpl.swr b/tests/queries/XPath-PT/A1.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/A2.xpl b/tests/queries/XPath-PT/A2.xpl
new file mode 100644 (file)
index 0000000..77b3a7a
--- /dev/null
@@ -0,0 +1 @@
+//closed_auction//keyword
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/A2.xpl.swr b/tests/queries/XPath-PT/A2.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/A3.xpl b/tests/queries/XPath-PT/A3.xpl
new file mode 100644 (file)
index 0000000..e0c9f76
--- /dev/null
@@ -0,0 +1 @@
+/site/closed_auctions/closed_auction//keyword
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/A3.xpl.swr b/tests/queries/XPath-PT/A3.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/A4.xpl b/tests/queries/XPath-PT/A4.xpl
new file mode 100644 (file)
index 0000000..a4bb406
--- /dev/null
@@ -0,0 +1 @@
+/site/closed_auctions/closed_auction[annotation/description/text/keyword]/date
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/A4.xpl.swr b/tests/queries/XPath-PT/A4.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/A5.xpl b/tests/queries/XPath-PT/A5.xpl
new file mode 100644 (file)
index 0000000..f9c2a1d
--- /dev/null
@@ -0,0 +1 @@
+/site/closed_auctions/closed_auction[descendant::keyword]/date
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/A5.xpl.swr b/tests/queries/XPath-PT/A5.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/A6.xpl b/tests/queries/XPath-PT/A6.xpl
new file mode 100644 (file)
index 0000000..d171b85
--- /dev/null
@@ -0,0 +1 @@
+/site/people/person[profile/gender and profile/age]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/A6.xpl.swr b/tests/queries/XPath-PT/A6.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/A7.xpl b/tests/queries/XPath-PT/A7.xpl
new file mode 100644 (file)
index 0000000..9ec33b6
--- /dev/null
@@ -0,0 +1 @@
+/site/people/person[phone or homepage]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/A7.xpl.swr b/tests/queries/XPath-PT/A7.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/A8.xpl b/tests/queries/XPath-PT/A8.xpl
new file mode 100644 (file)
index 0000000..71c1125
--- /dev/null
@@ -0,0 +1 @@
+/site/people/person[address and (phone or homepage) and (creditcard or profile)]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/A8.xpl.swr b/tests/queries/XPath-PT/A8.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B1.xpl b/tests/queries/XPath-PT/B1.xpl
new file mode 100644 (file)
index 0000000..b746c87
--- /dev/null
@@ -0,0 +1 @@
+/site/regions/*/item[parent::namerica or parent::samerica]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B1.xpl.swr b/tests/queries/XPath-PT/B1.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B10.xpl b/tests/queries/XPath-PT/B10.xpl
new file mode 100644 (file)
index 0000000..c718b76
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[(not(bidder/following::bidder) or not(bidder/preceding::bidder)) and (bidder/following::bidder and bidder/preceding::bidder)]/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B10.xpl.swr b/tests/queries/XPath-PT/B10.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B2.xpl b/tests/queries/XPath-PT/B2.xpl
new file mode 100644 (file)
index 0000000..a2c4ea9
--- /dev/null
@@ -0,0 +1 @@
+//keyword/ancestor::listitem/text/keyword
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B2.xpl.swr b/tests/queries/XPath-PT/B2.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B3.xpl b/tests/queries/XPath-PT/B3.xpl
new file mode 100644 (file)
index 0000000..3461866
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction/bidder[following-sibling::bidder]
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B3.xpl.swr b/tests/queries/XPath-PT/B3.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B4.xpl b/tests/queries/XPath-PT/B4.xpl
new file mode 100644 (file)
index 0000000..369086c
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction/bidder[preceding-sibling::bidder]
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B4.xpl.swr b/tests/queries/XPath-PT/B4.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B5.xpl b/tests/queries/XPath-PT/B5.xpl
new file mode 100644 (file)
index 0000000..9c36ad6
--- /dev/null
@@ -0,0 +1 @@
+/site/regions/*/item[following::item]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B5.xpl.swr b/tests/queries/XPath-PT/B5.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B6.xpl b/tests/queries/XPath-PT/B6.xpl
new file mode 100644 (file)
index 0000000..ecae27f
--- /dev/null
@@ -0,0 +1 @@
+/site/regions/*/item[preceding::item]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B6.xpl.swr b/tests/queries/XPath-PT/B6.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B7.xpl b/tests/queries/XPath-PT/B7.xpl
new file mode 100644 (file)
index 0000000..282cf30
--- /dev/null
@@ -0,0 +1 @@
+//person[profile/@income]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B7.xpl.swr b/tests/queries/XPath-PT/B7.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B8.xpl b/tests/queries/XPath-PT/B8.xpl
new file mode 100644 (file)
index 0000000..5c20aaf
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[bidder and not(bidder/preceding-sibling::bidder)]/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B8.xpl.swr b/tests/queries/XPath-PT/B8.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/B9.xpl b/tests/queries/XPath-PT/B9.xpl
new file mode 100644 (file)
index 0000000..c3672a1
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[(not(bidder/following::bidder) or not(bidder/preceding::bidder)) or (bidder/following::bidder and bidder/preceding::bidder)]/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/B9.xpl.swr b/tests/queries/XPath-PT/B9.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/C1.xpl b/tests/queries/XPath-PT/C1.xpl
new file mode 100644 (file)
index 0000000..0e847a1
--- /dev/null
@@ -0,0 +1 @@
+/site/people/person[profile/age >= 18 and profile/@income < 10000 and address/city != 'Dallas']/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/C1.xpl.swr b/tests/queries/XPath-PT/C1.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/C2.xpl b/tests/queries/XPath-PT/C2.xpl
new file mode 100644 (file)
index 0000000..253feb3
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[bidder/increase = current]/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/C2.xpl.swr b/tests/queries/XPath-PT/C2.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/C3.xpl b/tests/queries/XPath-PT/C3.xpl
new file mode 100644 (file)
index 0000000..58f220a
--- /dev/null
@@ -0,0 +1 @@
+/site/people/person[profile/@income = /site/open_auctions/open_auction/current]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/C3.xpl.swr b/tests/queries/XPath-PT/C3.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/C4.xpl b/tests/queries/XPath-PT/C4.xpl
new file mode 100644 (file)
index 0000000..5c33655
--- /dev/null
@@ -0,0 +1 @@
+/site/people/person[watches/watch/id(@open_auction)/seller/@person = @id]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/C4.xpl.swr b/tests/queries/XPath-PT/C4.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/C5.xpl b/tests/queries/XPath-PT/C5.xpl
new file mode 100644 (file)
index 0000000..03e7006
--- /dev/null
@@ -0,0 +1 @@
+id('person0')/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/C5.xpl.swr b/tests/queries/XPath-PT/C5.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/C6.xpl b/tests/queries/XPath-PT/C6.xpl
new file mode 100644 (file)
index 0000000..25e2ceb
--- /dev/null
@@ -0,0 +1 @@
+/site/people/person/watches/watch/id(@open_auction)/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/C6.xpl.swr b/tests/queries/XPath-PT/C6.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/C7.xpl b/tests/queries/XPath-PT/C7.xpl
new file mode 100644 (file)
index 0000000..a25622a
--- /dev/null
@@ -0,0 +1 @@
+/site/people/person[watches/watch/id(@open_auction)/itemref/id(@item)/parent::australian]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/C7.xpl.swr b/tests/queries/XPath-PT/C7.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/D1.xpl b/tests/queries/XPath-PT/D1.xpl
new file mode 100644 (file)
index 0000000..5a7a01b
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[(count(bidder) mod 2) = 0]/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/D1.xpl.swr b/tests/queries/XPath-PT/D1.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/D2.xpl b/tests/queries/XPath-PT/D2.xpl
new file mode 100644 (file)
index 0000000..ae115be
--- /dev/null
@@ -0,0 +1 @@
+count(//text) + count(//bold) + count(//emph) + count(//keyword)
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/D2.xpl.swr b/tests/queries/XPath-PT/D2.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/D3.xpl b/tests/queries/XPath-PT/D3.xpl
new file mode 100644 (file)
index 0000000..73b00b6
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[sum(bidder/increase) > 10 * initial]/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/D3.xpl.swr b/tests/queries/XPath-PT/D3.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/D4.xpl b/tests/queries/XPath-PT/D4.xpl
new file mode 100644 (file)
index 0000000..9dd6b5d
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[sum(bidder/increase) != (current - initial)]/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/D4.xpl.swr b/tests/queries/XPath-PT/D4.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/D5.xpl b/tests/queries/XPath-PT/D5.xpl
new file mode 100644 (file)
index 0000000..eae25b6
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[bidder and (sum(bidder/increase) div count(bidder)) > 2 * initial]/interval"
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/D5.xpl.swr b/tests/queries/XPath-PT/D5.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/E1.xpl b/tests/queries/XPath-PT/E1.xpl
new file mode 100644 (file)
index 0000000..74e1692
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction[number(bidder[1]/increase) < number(bidder[floor((last() + 1) div 2)]/increase) and number(bidder[floor((last() + 1) div 2)]/increase) < number(bidder[last()]/increase)]/interval
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/E1.xpl.swr b/tests/queries/XPath-PT/E1.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/E2.xpl b/tests/queries/XPath-PT/E2.xpl
new file mode 100644 (file)
index 0000000..342cc79
--- /dev/null
@@ -0,0 +1 @@
+/site/regions/europe/item/description/descendant::keyword[last()]
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/E2.xpl.swr b/tests/queries/XPath-PT/E2.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/E3.xpl b/tests/queries/XPath-PT/E3.xpl
new file mode 100644 (file)
index 0000000..7221800
--- /dev/null
@@ -0,0 +1 @@
+//keyword/ancestor::listitem[1]/text/keyword
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/E3.xpl.swr b/tests/queries/XPath-PT/E3.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/E4.xpl b/tests/queries/XPath-PT/E4.xpl
new file mode 100644 (file)
index 0000000..638038f
--- /dev/null
@@ -0,0 +1 @@
+/site/open_auctions/open_auction/bidder[number(preceding-sibling::bidder[1]/increase) <= number(increase) and number(increase) <= number(following-sibling::bidder[1]/increase)]
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/E4.xpl.swr b/tests/queries/XPath-PT/E4.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/E5.xpl b/tests/queries/XPath-PT/E5.xpl
new file mode 100644 (file)
index 0000000..0c039d9
--- /dev/null
@@ -0,0 +1 @@
+/site/regions/*/item[preceding::item[100] and following::item[100]]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/E5.xpl.swr b/tests/queries/XPath-PT/E5.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/E6.xpl b/tests/queries/XPath-PT/E6.xpl
new file mode 100644 (file)
index 0000000..60cf142
--- /dev/null
@@ -0,0 +1 @@
+/site/regions/*/item[contains(description, name)]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/E6.xpl.swr b/tests/queries/XPath-PT/E6.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/E7.xpl b/tests/queries/XPath-PT/E7.xpl
new file mode 100644 (file)
index 0000000..655fe12
--- /dev/null
@@ -0,0 +1 @@
+/site/regions/*/item[contains(substring-before(description, 'eros'), 'passion') and contains(substring-after(description, 'eros'), 'dangerous')]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/E7.xpl.swr b/tests/queries/XPath-PT/E7.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/XPath-PT/E8.xpl b/tests/queries/XPath-PT/E8.xpl
new file mode 100644 (file)
index 0000000..cdd955a
--- /dev/null
@@ -0,0 +1 @@
+/site/regions/*/item[string-length(translate(normalize-space(description),' ','')) > 10000]/name
\ No newline at end of file
diff --git a/tests/queries/XPath-PT/E8.xpl.swr b/tests/queries/XPath-PT/E8.xpl.swr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/queries/test.qu b/tests/queries/test.qu
new file mode 100644 (file)
index 0000000..5367042
--- /dev/null
@@ -0,0 +1 @@
+/descendant::*[descendant::L]
\ No newline at end of file