MCPcopy Create free account
hub / github.com/BaseXdb/basex / SimpleTest

Class SimpleTest

basex-core/src/test/java/org/basex/query/simple/SimpleTest.java:13–336  ·  view source on GitHub ↗

Simple XQuery tests. @author BaseX Team, BSD License @author Christian Gruen

Source from the content-addressed store, hash-verified

11 * @author Christian Gruen
12 */
13public final class SimpleTest extends QueryTest {
14 static {
15 create("<x>X</x>");
16
17 queries = new Object[][] {
18 { "Number 1", decimal(2), "1.+1." },
19
20 { "Float 1", "xs:float('Infinity')" },
21 { "Float 2", "xs:float('infinity')" },
22 { "Float 3", booleans(true), "xs:float('INF') > 0" },
23 { "Float 4", "xs:float('inf')" },
24 { "Float 5", "xs:float('-Infinity')" },
25 { "Float 6", "xs:float('-infinity')" },
26 { "Float 7", booleans(true), "xs:float('-INF') < 0" },
27 { "Float 8", "xs:float('-inf')" },
28 { "Float 9", booleans(true), "xs:float('+INF') > 0" },
29
30 { "Double 1", "xs:double('Infinity')" },
31 { "Double 2", "xs:double('infinity')" },
32 { "Double 3", booleans(true), "xs:double('INF') > 0" },
33 { "Double 4", "xs:double('inf')" },
34 { "Double 5", "xs:double('-Infinity')" },
35 { "Double 6", "xs:double('-infinity')" },
36 { "Double 7", booleans(true), "xs:double('-INF') < 0" },
37 { "Double 8", "xs:double('-inf')" },
38 { "Double 9", booleans(true), "xs:double('+INF') > 0" },
39
40 { "UnsignedLong 1", booleans(false), "xs:unsignedLong('3') eq 3.1"},
41 { "UnsignedLong 2", booleans(false), "3.1 eq xs:unsignedLong('3')"},
42 { "UnsignedLong 3", booleans(true), "xs:unsignedLong(3) lt 3.1"},
43 { "UnsignedLong 4", booleans(true), "3.1 gt xs:unsignedLong(3)"},
44 { "UnsignedLong 5", integers(1), "compare(3.1, xs:unsignedLong('3'))"},
45 { "UnsignedLong 6", integers(-1), "compare(xs:unsignedLong('3'), 3.1)"},
46
47 { "Annotation 1", integers(1), "declare %local:x(.1) variable $a := 1; $a" },
48 { "Annotation 2", integers(1), "declare %local:x(1.) variable $a := 1; $a" },
49 { "Annotation 3", "declare %local:x(.) variable $a := 1; $a" },
50
51 { "Compare 1", booleans(true), "xs:QName('b') = attribute a { 'b' }" },
52 { "Compare 2", booleans(false), "<a/>/x = (c, ())" },
53 { "Compare 3", booleans(false), "(4, 5, 6) < (1, 2)" },
54 { "Compare 4", booleans(false), "(4, 5) < (1, 2, 3)" },
55 { "Compare 5", booleans(false), "1234567890.12345678 = 1234567890.1234567" },
56 { "Compare 6", booleans(false), "123456789012345678 = 123456789012345679" },
57 // GH-2112, GH-2115
58 { "Compare 7", booleans(true), "xs:decimal(1.13) gt xs:double(1.13)" },
59 { "Compare 8", booleans(true), "xs:decimal(1.13) gt xs:float(1.13)" },
60 { "Compare 9", booleans(false), "xs:decimal(1.13) le xs:double(1.13)" },
61 { "Compare 10", booleans(false), "xs:decimal(1.13) le xs:float(1.13)" },
62 // GH-2113, GH-2114
63 { "Compare 11", booleans(false), "xs:float (1.13) ge xs:double(1.13)" },
64 { "Compare 12", booleans(true), "xs:float (1.13) le xs:double(1.13)" },
65 { "Compare 13", booleans(true), "xs:float (1.13) lt xs:double(1.13)" },
66 { "Compare 14", booleans(false), "xs:float (1.13) gt xs:double(1.13)" },
67 { "Compare 15", booleans(true), "xs:double(1.13) ge xs:float (1.13)" },
68 { "Compare 16", booleans(false), "xs:double(1.13) le xs:float (1.13)" },
69 { "Compare 17", booleans(false), "xs:double(1.13) lt xs:float (1.13)" },
70 { "Compare 18", booleans(true), "xs:double(1.13) gt xs:float (1.13)" },

Callers

nothing calls this directly

Calls 8

decimalMethod · 0.80
booleansMethod · 0.80
argsMethod · 0.65
createMethod · 0.45
integersMethod · 0.45
emptySequenceMethod · 0.45
stringsMethod · 0.45
nodesMethod · 0.45

Tested by

no test coverage detected