summaryrefslogtreecommitdiff
path: root/test/XPath/expr
diff options
context:
space:
mode:
Diffstat (limited to 'test/XPath/expr')
-rw-r--r--test/XPath/expr/base5
-rw-r--r--test/XPath/expr/compare46
-rw-r--r--test/XPath/expr/equality26
-rw-r--r--test/XPath/expr/floats61
-rw-r--r--test/XPath/expr/functions25
-rw-r--r--test/XPath/expr/strings34
6 files changed, 197 insertions, 0 deletions
diff --git a/test/XPath/expr/base b/test/XPath/expr/base
new file mode 100644
index 0000000..9aaed4f
--- /dev/null
+++ b/test/XPath/expr/base
@@ -0,0 +1,5 @@
+1
+1+2
+2*3
+1+2*3+4
+(1+2)*(3+4)
diff --git a/test/XPath/expr/compare b/test/XPath/expr/compare
new file mode 100644
index 0000000..2d52eaf
--- /dev/null
+++ b/test/XPath/expr/compare
@@ -0,0 +1,46 @@
+0<0
+0<=0
+0>0
+0>=0
+0<1
+0<=1
+0>1
+0>=1
+1<0
+1<=0
+1>0
+1>=0
+1<1
+1<=1
+1>1
+1>=1
+'0'<1
+'0'<=1
+'0'>1
+'0'>=1
+0<'1.2'
+0<='1.2'
+0>'1.2'
+0>='1.2'
+0<'-0.2'
+0<='-0.2'
+0>'-0.2'
+0>='-0.2'
+false()<1
+false()<=1
+0>true()
+0>=true()
+'a' > 'a'
+'a' > 'b'
+'b' > 'a'
+'a' < 'a'
+'a' < 'b'
+'b' < 'a'
+'a' >= 'a'
+'a' >= 'b'
+'b' >= 'a'
+'a' <= 'a'
+'a' <= 'b'
+'b' <= 'a'
+'a' > '0.0'
+'a' < '0.0'
diff --git a/test/XPath/expr/equality b/test/XPath/expr/equality
new file mode 100644
index 0000000..7982173
--- /dev/null
+++ b/test/XPath/expr/equality
@@ -0,0 +1,26 @@
+1=1
+1!=1
+1=0
+1!=0
+true()=true()
+true()!=true()
+true()=false()
+false()!=true()
+'test'='test'
+'test'!='test'
+'test2'='test'
+'test2'!='test'
+false()=0
+false()!=0
+false()=1
+false()!=1
+0=true()
+0!=true()
+1=true()
+1!=true()
+true()='test'
+false()='test'
+'test'!=true()
+'test'!=false()
+'a'=0.0
+'a'!=0.0
diff --git a/test/XPath/expr/floats b/test/XPath/expr/floats
new file mode 100644
index 0000000..96c10d1
--- /dev/null
+++ b/test/XPath/expr/floats
@@ -0,0 +1,61 @@
+1
+123
+1.23
+0.123
+4.
+.4
+1.23e3
+1.23e-3
+1 div 0
+-1 div 0
+0 div 0
+1 div -0
+(1 div 0) > 0
+(1 div 0) < 0
+(-1 div 0) > 0
+(-1 div 0) < 0
+(0 div 0) > 0
+(0 div 0) < 0
+(1 div -0) > 0
+(1 div -0) < 0
+0 div 0 = 0 div 0
+0 div 0 != 0 div 0
+0 div 0 > 0 div 0
+0 div 0 < 0 div 0
+0 div 0 >= 0 div 0
+0 div 0 <= 0 div 0
+1 div 0 = -1 div 0
+1 div 0 != -1 div 0
+1 div 0 > -1 div 0
+1 div 0 < -1 div 0
+1 div 0 >= -1 div 0
+1 div 0 <= -1 div 0
+1 div 0 = 1 div 0
+1 div 0 != 1 div 0
+1 div 0 > 1 div 0
+1 div 0 < 1 div 0
+1 div 0 >= -1 div 0
+1 div 0 <= -1 div 0
+-2 div 0 = -1 div 0
+1 div floor(0.1)
+1 div floor(-0.1)
+1 div floor(-0)
+1 div floor(0)
+1 div ceiling(0.1)
+1 div ceiling(-0.1)
+1 div ceiling(-0)
+1 div ceiling(0)
+1 div round(0.1)
+1 div round(-0.1)
+1 div round(-0)
+1 div round(0)
+1 div number('f')
+number('f') div 1
+1 div (1 div 0)
+(1 div 0) div 1
+-(1 div 0) div 1
+5 mod 2
+5 mod -2
+-5 mod 2
+-5 mod -2
+8 mod 3 = 2
diff --git a/test/XPath/expr/functions b/test/XPath/expr/functions
new file mode 100644
index 0000000..d168b18
--- /dev/null
+++ b/test/XPath/expr/functions
@@ -0,0 +1,25 @@
+true()
+false()
+number("1.5")
+number('abc')
+-number('abc')
+floor(0.1)
+floor(-0.1)
+floor(-0)
+floor(0)
+floor(5.2)
+floor(-5.2)
+ceiling(0.1)
+ceiling(-0.1)
+ceiling(-0)
+ceiling(0)
+ceiling(5.2)
+ceiling(-5.2)
+round(0.1)
+round(5.2)
+round(5.5)
+round(5.6)
+round(-0.1)
+round(-5.2)
+round(-5.5)
+round(-5.6)
diff --git a/test/XPath/expr/strings b/test/XPath/expr/strings
new file mode 100644
index 0000000..849ca14
--- /dev/null
+++ b/test/XPath/expr/strings
@@ -0,0 +1,34 @@
+string(5)
+string(0.5)
+string(-0.5)
+string(true())
+string(false())
+concat("titi","toto")
+concat("titi","toto","tata")
+concat("titi",'toto')
+concat("titi",'toto',"tata","last")
+starts-with("tititoto","titi")
+starts-with("tititoto","to")
+contains("tititototata","titi")
+contains("tititototata","toto")
+contains("tititototata","tata")
+contains("tititototata","tita")
+substring("12345",2,3)
+substring("12345",2)
+substring("12345",-4)
+substring("12345",3.4)
+substring("12345",3.6)
+substring("12345",1.5,2.6)
+substring("12345",2.2,2.2)
+substring("12345",0,3)
+substring("12345",-8,10)
+substring("12345",4,-10)
+substring("12345",0 div 0, 3)
+substring("12345",1, 0 div 0)
+substring("12345",1 div 0, 3)
+substring("12345",3,-1 div 0)
+substring("12345",-42, 1 div 0)
+substring("12345",-1 div 0, 1 div 0)
+substring("12345",-1 div 0,5)
+string-length("")
+string-length("titi")