2010
|
1 |
"{ Package: 'stx:goodies/regression' }"
|
|
2 |
|
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
|
5 |
TestCase subclass:#XPathTests
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'tests-Regression-XML'
|
|
10 |
!
|
|
11 |
|
|
12 |
!XPathTests class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
documentation
|
|
15 |
"
|
|
16 |
documentation to be added.
|
|
17 |
|
|
18 |
[author:]
|
|
19 |
Claus Gittinger
|
|
20 |
|
|
21 |
[instance variables:]
|
|
22 |
|
|
23 |
[class variables:]
|
|
24 |
|
|
25 |
[see also:]
|
|
26 |
|
|
27 |
"
|
|
28 |
! !
|
|
29 |
|
|
30 |
!XPathTests methodsFor:'tests'!
|
|
31 |
|
|
32 |
test01
|
|
33 |
|node child|
|
|
34 |
|
|
35 |
"/ 123456789012
|
|
36 |
node := XML::XPathParser parse:'/foo/bar/baz'.
|
|
37 |
self assert:(node condensedPrintString = '/foo/bar/baz').
|
|
38 |
|
|
39 |
self assert:(node startPosition == 1).
|
|
40 |
self assert:(node endPosition == 1).
|
|
41 |
self assert:(node isXPathRoot).
|
|
42 |
|
|
43 |
child := node child.
|
|
44 |
self assert:(child startPosition == 2).
|
|
45 |
"/ self assert:(child endPosition == 4).
|
|
46 |
|
|
47 |
child := child child.
|
|
48 |
self assert:(child startPosition == 6).
|
|
49 |
"/ self assert:(child endPosition == 8).
|
|
50 |
|
|
51 |
child := child child.
|
|
52 |
self assert:(child startPosition == 10).
|
|
53 |
"/ self assert:(child endPosition == 12).
|
|
54 |
|
|
55 |
"/ 123456789012
|
|
56 |
node := XML::XPathParser parse:'/foo/../baz'.
|
|
57 |
self assert:(node condensedPrintString = '/foo/../baz').
|
|
58 |
|
|
59 |
self assert:(node startPosition == 1).
|
|
60 |
self assert:(node endPosition == 1).
|
|
61 |
self assert:(node isXPathRoot).
|
|
62 |
|
|
63 |
child := node child.
|
|
64 |
self assert:(child startPosition == 2).
|
|
65 |
"/ self assert:(child endPosition == 4).
|
|
66 |
|
|
67 |
child := child child.
|
|
68 |
self assert:(child startPosition == 6).
|
|
69 |
"/ self assert:(child endPosition == 7).
|
|
70 |
|
|
71 |
child := child child.
|
|
72 |
self assert:(child startPosition == 9).
|
|
73 |
"/ self assert:(child endPosition == 11).
|
|
74 |
|
|
75 |
"/ 123456789012
|
|
76 |
node := XML::XPathParser parse:'/foo[1]/baz'.
|
|
77 |
self assert:(node condensedPrintString = '/foo[1]/baz').
|
|
78 |
|
|
79 |
self assert:(node startPosition == 1).
|
|
80 |
self assert:(node endPosition == 1).
|
|
81 |
self assert:(node isXPathRoot).
|
|
82 |
|
|
83 |
child := node child.
|
|
84 |
self assert:(child startPosition == 2).
|
|
85 |
"/ self assert:(child endPosition == 4).
|
|
86 |
|
|
87 |
child := child child.
|
|
88 |
self assert:(child startPosition == 9).
|
|
89 |
"/ self assert:(child endPosition == 11).
|
|
90 |
|
|
91 |
"/ 1234567890123456789
|
|
92 |
node := XML::XPathParser parse:'/foo[@name="bla"]/baz'.
|
|
93 |
self assert:(node condensedPrintString = '/foo[@name = "bla"]/baz').
|
|
94 |
|
|
95 |
self assert:(node startPosition == 1).
|
|
96 |
self assert:(node endPosition == 1).
|
|
97 |
self assert:(node isXPathRoot).
|
|
98 |
|
|
99 |
child := node child.
|
|
100 |
self assert:(child startPosition == 2).
|
|
101 |
"/ self assert:(child endPosition == 4).
|
|
102 |
|
|
103 |
child := child child.
|
|
104 |
self assert:(child startPosition == 19).
|
|
105 |
"/ self assert:(child endPosition == 11).
|
|
106 |
|
|
107 |
"
|
|
108 |
self run:#test01
|
|
109 |
self new test01
|
|
110 |
"
|
|
111 |
|
|
112 |
"Created: / 24-09-2018 / 20:17:35 / Claus Gittinger"
|
|
113 |
! !
|
|
114 |
|
|
115 |
!XPathTests class methodsFor:'documentation'!
|
|
116 |
|
|
117 |
version_CVS
|
|
118 |
^ '$Header$'
|
|
119 |
! !
|
|
120 |
|