• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Testing HDF set and dump
2
3Foo.Bar = 10
4Foo.Baz = 20
5
6Testing HDF get
7
810
920
10----
11Testing HDF setSymLink
12
1320
14----
15Testing HDF get where default value is null
16
17foo = 10
18foo = null
19----
20Testing HDF get int
21
2210
23----
24Testing HDF parse/render
25
26Foo.Bar:<?cs var:Foo.Bar ?>
27Foo.Baz:<?cs var:Foo.Baz ?>
28
29----
30Foo.Bar:10
31Foo.Baz:20
32
33Testing registered string functions
34
35Foo.Bar:10
36Foo.Baz:20
37 abc%26+231%3C%3E%2F%3F abc&amp; 231&lt;&gt;/?
38Testing white space stripping
39
40      10 This is a       string     without whitespace stripped
41  10 This is a string without whitespace stripped
42Testing debug dump
43
44  10 This is a string without whitespace stripped<hr><pre>Foo.Bar = 10
45Foo.Baz = 20
46Foo.Baz2 : Foo.Baz
47Foo.EscapeTest = abc& 231<>/?
48ClearSilver.WhiteSpaceStrip = 1
49ClearSilver.DisplayDebug = 1
50</pre>
51Final HDF dump
52
53Foo.Bar = 10
54Foo.Baz = 20
55Foo.Baz2 : Foo.Baz
56Foo.EscapeTest = abc& 231<>/?
57ClearSilver.WhiteSpaceStrip = 1
58ClearSilver.DisplayDebug = 1
59
60Testing HDF.readFile()
61
62Foo.Bar = 10
63Foo.Baz = 20
64
65Testing HDF.readFile() for a file that doesn't exist
66Caught exception of type java.io.FileNotFoundException
67
68Testing HDF.writeFile()
69
70Testing HDF.writeString()
71
72Foo {
73Bar = 10
74Baz = 20
75}
76
77Testing HDF.getObj()
78Bar = 10
79Baz = 20
80
81Testing HDF.objName()
82Should be "Foo": Foo
83Should be "Bar": Bar
84Should be null: null
85
86Testing HDF.objValue()
87Value of Foo.Bar: 10
88Value of root node: null
89
90Testing HDF.objChild()
91First child name: Bar
92
93Testing HDF.objNext()
94Next child name: Baz
95Next child (should be null): null
96
97Testing HDF.copy()
98name should be barneyb: barneyb
99
100Testing HDF.exportDate()
101DatePST.sec = 18
102DatePST.min = 50
103DatePST.24hour = 19
104DatePST.hour = 7
105DatePST.am = 0
106DatePST.mday = 13
107DatePST.mon = 3
108DatePST.year = 2006
109DatePST.2yr = 06
110DatePST.wday = 2
111DatePST.tzoffset = -0800
112DateEST.sec = 18
113DateEST.min = 50
114DateEST.24hour = 22
115DateEST.hour = 10
116DateEST.am = 0
117DateEST.mday = 13
118DateEST.mon = 3
119DateEST.year = 2006
120DateEST.2yr = 06
121DateEST.wday = 2
122DateEST.tzoffset = -0500
123
124Testing escape mode: html
125Config.VarEscapeMode = "html"
126Some.HTML = <script src="some.js">alert('123');</script>
127Default HTML escaping: <?cs var:Some.HTML ?>
128
129----
130Default HTML escaping: &lt;script src=&quot;some.js&quot;&gt;alert(&#39;123&#39;);&lt;/script&gt;
131
132Testing escape mode: js
133Config.VarEscapeMode = "js"
134Some.HTML = <script src="some.js">alert('123');</script>
135Default JS escaping: <?cs var:Some.HTML ?>
136
137----
138Default JS escaping: \x3Cscript src=\x22some.js\x22\x3Ealert(\x27123\x27)\x3B\x3C\x2Fscript\x3E
139
140Testing escape mode: url
141Config.VarEscapeMode = "url"
142Some.HTML = <script src="some.js">alert('123');</script>
143Default URL escaping: <?cs var:Some.HTML ?>
144
145----
146Default URL escaping: %3Cscript+src%3D%22some.js%22%3Ealert(%27123%27)%3B%3C%2Fscript%3E
147
148Testing escape blocks: none
149Config.VarEscapeMode = "none"
150Some.HTML = <script src="some.js">alert('123');</script>
151url escape block:
152<?cs escape: "url"?>  <?cs var:Some.HTML ?><?cs /escape ?>
153js escape block:
154<?cs escape: "js"?>  <?cs var:Some.HTML ?><?cs /escape ?>
155html escape block:
156<?cs escape: "html"?>  <?cs var:Some.HTML ?><?cs /escape ?>
157
158----
159url escape block:
160  %3Cscript+src%3D%22some.js%22%3Ealert(%27123%27)%3B%3C%2Fscript%3E
161js escape block:
162  \x3Cscript src=\x22some.js\x22\x3Ealert(\x27123\x27)\x3B\x3C\x2Fscript\x3E
163html escape block:
164  &lt;script src=&quot;some.js&quot;&gt;alert(&#39;123&#39;);&lt;/script&gt;
165
166Testing HDF.readFile() with callback
167
168CSTestLoader::Load testdata/test1.hdf
169
170---- file begin ----
171# Simple HDF file to test that HDF.readFile() works
172Foo.Bar = 10
173Foo.Baz = 20
174
175---- file end ----
176
177Foo.Bar = 10
178Foo.Baz = 20
179
180Testing CS.parseFile() with callback
181
182CSTestLoader::Load testdata/test.cs
183
184---- file begin ----
185Testing CS parse file...
186
187<?cs set:Foo.Frank = "Beans" ?>
188
189<?cs each:f = Foo ?>
190  <?cs var:f ?>
191<?cs /each ?>
192
193---- file end ----
194
195Testing CS parse file...
196
197
198
199
200  10
201
202  20
203
204  Beans
205
206
207