650
|
1 |
"
|
|
2 |
Copyright (c) 2007-2010 Jan Vrany
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
|
4 |
|
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
25 |
"
|
|
26 |
"{ Package: 'stx:libsvn' }"
|
|
27 |
|
|
28 |
"{ NameSpace: SVN }"
|
|
29 |
|
|
30 |
TestCase subclass:#PackagePatternTests
|
|
31 |
instanceVariableNames:''
|
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'SVN-Tests'
|
|
35 |
!
|
|
36 |
|
|
37 |
!PackagePatternTests class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
|
41 |
Copyright (c) 2007-2010 Jan Vrany
|
|
42 |
Copyright (c) 2009-2010 eXept Software AG
|
|
43 |
|
|
44 |
Permission is hereby granted, free of charge, to any person
|
|
45 |
obtaining a copy of this software and associated documentation
|
|
46 |
files (the 'Software'), to deal in the Software without
|
|
47 |
restriction, including without limitation the rights to use,
|
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49 |
copies of the Software, and to permit persons to whom the
|
|
50 |
Software is furnished to do so, subject to the following
|
|
51 |
conditions:
|
|
52 |
|
|
53 |
The above copyright notice and this permission notice shall be
|
|
54 |
included in all copies or substantial portions of the Software.
|
|
55 |
|
|
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
63 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
64 |
|
|
65 |
"
|
|
66 |
! !
|
|
67 |
|
|
68 |
!PackagePatternTests methodsFor:'tests'!
|
|
69 |
|
|
70 |
test_01
|
|
71 |
|
|
72 |
self assert: ((PackagePattern for:'stx:goodies') matches: 'stx:goodies').
|
|
73 |
self assert: ((PackagePattern for:'stx:goodies/xml') matches: 'stx:goodies/xml').
|
|
74 |
self deny: ((PackagePattern for:'stx:goodies/XML') matches: 'stx:goodies').
|
|
75 |
self deny: ((PackagePattern for:'stx:goodies/XML') matches: 'stx:goodies/xml').
|
|
76 |
|
|
77 |
"Created: / 12-03-2011 / 22:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
78 |
!
|
|
79 |
|
|
80 |
test_02
|
|
81 |
|
|
82 |
| pp d |
|
|
83 |
pp := PackagePattern for:'stx:goodies/*'.
|
|
84 |
d := Dictionary new.
|
|
85 |
|
|
86 |
self assert: ( pp matches: 'stx:goodies' ).
|
|
87 |
self assert: ( pp match: 'stx:goodies' into: d).
|
|
88 |
self assert: ( d at: '1') = ''.
|
|
89 |
|
|
90 |
self assert: ( pp match: 'stx:goodies/xml' into: d).
|
|
91 |
self assert: ( d at: '1') = 'xml'.
|
|
92 |
|
|
93 |
self assert: ( pp match: 'stx:goodies/xml/vw' into: d).
|
|
94 |
self assert: ( d at: '1') = 'xml/vw'.
|
|
95 |
|
|
96 |
"Created: / 13-03-2011 / 07:40:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
97 |
!
|
|
98 |
|
|
99 |
test_03
|
|
100 |
|
|
101 |
| pp d |
|
|
102 |
pp := PackagePattern for:'*'.
|
|
103 |
d := Dictionary new.
|
|
104 |
|
|
105 |
self assert: ( pp matches: 'stx:goodies' ).
|
|
106 |
self assert: ( pp match: 'stx:goodies' into: d).
|
|
107 |
self assert: ( d at: '1') = 'stx/goodies'.
|
|
108 |
|
|
109 |
"Created: / 13-03-2011 / 07:51:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
110 |
!
|
|
111 |
|
|
112 |
test_04
|
|
113 |
|
|
114 |
| pp d |
|
|
115 |
pp := PackagePattern for:'stx:goodies/*/test'.
|
|
116 |
d := Dictionary new.
|
|
117 |
|
|
118 |
|
|
119 |
self assert: ( pp match: 'stx:goodies/xml/test' into: d).
|
|
120 |
self assert: ( d at: '1') = 'xml'.
|
|
121 |
|
|
122 |
"Created: / 13-03-2011 / 07:52:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
123 |
!
|
|
124 |
|
|
125 |
test_05
|
|
126 |
|
|
127 |
| pp d |
|
|
128 |
pp := PackagePattern for:'stx:goodies/*/test/*'.
|
|
129 |
d := Dictionary new.
|
|
130 |
|
|
131 |
self assert: ( pp match: 'stx:goodies/xml/test/dom' into: d).
|
|
132 |
self assert: ( d at: '1') = 'xml'.
|
|
133 |
self assert: ( d at: '2') = 'dom'.
|
|
134 |
|
|
135 |
d := Dictionary new.
|
|
136 |
self assert: ( pp match: 'stx:goodies/xml/test' into: d).
|
|
137 |
self assert: ( d at: '1') = 'xml'.
|
|
138 |
self assert: ( d at: '2') = ''.
|
|
139 |
|
|
140 |
"Created: / 13-03-2011 / 07:56:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
141 |
! !
|
|
142 |
|
|
143 |
!PackagePatternTests class methodsFor:'documentation'!
|
|
144 |
|
|
145 |
version
|
|
146 |
^ '$Header$'
|
|
147 |
!
|
|
148 |
|
|
149 |
version_CVS
|
|
150 |
^ '$Header$'
|
|
151 |
!
|
|
152 |
|
|
153 |
version_SVN
|
|
154 |
^ '§Id: SVN__PackagePatternTests.st 350 2011-07-07 18:42:56Z vranyj1 §'
|
|
155 |
! !
|