sdl4r 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/CHANGELOG +14 -1
  2. data/README +4 -4
  3. data/Rakefile +15 -12
  4. data/TODO +11 -4
  5. data/lib/sdl4r/parser.rb +25 -33
  6. data/lib/sdl4r/parser/token.rb +1 -1
  7. data/lib/sdl4r/sdl4r.rb +50 -22
  8. data/lib/sdl4r/sdl_time_span.rb +2 -2
  9. data/lib/sdl4r/serializer.rb +152 -0
  10. data/lib/sdl4r/tag.rb +15 -1
  11. data/test/sdl4r/parser_test.rb +5 -0
  12. data/test/sdl4r/serializer_test.rb +78 -0
  13. data/test/sdl4r/tag_test.rb +20 -1
  14. metadata +52 -81
  15. data/doc/classes/SDL4R.html +0 -408
  16. data/doc/classes/SDL4R/Parser.html +0 -190
  17. data/doc/classes/SDL4R/ParserTest.html +0 -385
  18. data/doc/classes/SDL4R/SDL4RTest.html +0 -532
  19. data/doc/classes/SDL4R/SDLTest.html +0 -77
  20. data/doc/classes/SDL4R/SdlBinary.html +0 -188
  21. data/doc/classes/SDL4R/SdlParseError.html +0 -110
  22. data/doc/classes/SDL4R/SdlTimeSpan.html +0 -637
  23. data/doc/classes/SDL4R/Tag.html +0 -1249
  24. data/doc/classes/SDL4R/TagTest.html +0 -292
  25. data/doc/created.rid +0 -1
  26. data/doc/files/CHANGELOG.html +0 -200
  27. data/doc/files/LICENSE.html +0 -497
  28. data/doc/files/README.html +0 -406
  29. data/doc/files/lib/sdl4r/parser/reader_rb.html +0 -54
  30. data/doc/files/lib/sdl4r/parser/time_span_with_zone_rb.html +0 -54
  31. data/doc/files/lib/sdl4r/parser/token_rb.html +0 -54
  32. data/doc/files/lib/sdl4r/parser/tokenizer_rb.html +0 -54
  33. data/doc/files/lib/sdl4r/parser_rb.html +0 -62
  34. data/doc/files/lib/sdl4r/sdl4r_rb.html +0 -64
  35. data/doc/files/lib/sdl4r/sdl_binary_rb.html +0 -54
  36. data/doc/files/lib/sdl4r/sdl_parse_error_rb.html +0 -54
  37. data/doc/files/lib/sdl4r/sdl_time_span_rb.html +0 -54
  38. data/doc/files/lib/sdl4r/tag_rb.html +0 -64
  39. data/doc/files/lib/sdl4r_rb.html +0 -54
  40. data/doc/files/test/sdl4r/parser_test_rb.html +0 -64
  41. data/doc/files/test/sdl4r/sdl4r_test_rb.html +0 -67
  42. data/doc/files/test/sdl4r/sdl_test_rb.html +0 -64
  43. data/doc/files/test/sdl4r/tag_test_rb.html +0 -64
  44. data/doc/fr_class_index.html +0 -19
  45. data/doc/fr_file_index.html +0 -37
  46. data/doc/fr_method_index.html +0 -4711
  47. data/doc/index.html +0 -15
  48. data/doc/rdoc-style.css +0 -328
@@ -1,532 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
- <html lang='en'>
3
- <head>
4
- <title>: SDL4R::SDL4RTest [RDoc: Simple Declarative Language for Ruby]</title>
5
- <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
6
- <link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
- <script type='text/javascript'>
8
- //<![CDATA[
9
- function popupCode(url) {
10
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
- }
12
-
13
- function toggleCode(id) {
14
- var code = document.getElementById(id)
15
-
16
- code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
- return true
18
- }
19
-
20
- // Make codeblocks hidden by default
21
- document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
- //]]>
23
- </script>
24
- </head>
25
- <body class='page'>
26
- <div class='class' id='wrapper'>
27
- <div class='header'>
28
- <h1 class='name'>
29
- <span class='type'>Class</span>
30
- SDL4R::SDL4RTest
31
- </h1>
32
- <ol class='paths'>
33
- <li>
34
- <a href="../../files/test/sdl4r/sdl4r_test_rb.html">test/sdl4r/sdl4r_test.rb</a>
35
- </li>
36
- </ol>
37
- <div class='parent'>
38
- Parent:
39
- <strong>Test::Unit::TestCase</strong>
40
- </div>
41
- </div>
42
- <div id='content'>
43
- <div id='text'>
44
- <div id='description'>
45
- <p>
46
- SDL unit tests.
47
- </p>
48
- <p>
49
- @author Daniel Leuck
50
- </p>
51
- </div>
52
- <div id='method-list'>
53
- <h2>Methods</h2>
54
- <h3>public instance</h3>
55
- <ol>
56
- <li><a href="#M000130">assert_tags_equal</a></li>
57
- <li><a href="#M000136">check_tag_write_parse</a></li>
58
- <li><a href="#M000131">get_test_sdl_file_path</a></li>
59
- <li><a href="#M000132">setup</a></li>
60
- <li><a href="#M000149">test_attributes</a></li>
61
- <li><a href="#M000146">test_binaries</a></li>
62
- <li><a href="#M000141">test_booleans</a></li>
63
- <li><a href="#M000138">test_characters</a></li>
64
- <li><a href="#M000139">test_characters_unicode</a></li>
65
- <li><a href="#M000151">test_children</a></li>
66
- <li><a href="#M000145">test_date_times</a></li>
67
- <li><a href="#M000143">test_dates</a></li>
68
- <li><a href="#M000147">test_empty_tag</a></li>
69
- <li><a href="#M000152">test_namespaces</a></li>
70
- <li><a href="#M000142">test_null</a></li>
71
- <li><a href="#M000140">test_numbers</a></li>
72
- <li><a href="#M000137">test_strings</a></li>
73
- <li><a href="#M000133">test_tag</a></li>
74
- <li><a href="#M000134">test_tag_write_parse_basic_types</a></li>
75
- <li><a href="#M000135">test_tag_write_parse_structures</a></li>
76
- <li><a href="#M000144">test_time_spans</a></li>
77
- <li><a href="#M000148">test_values</a></li>
78
- <li><a href="#M000150">test_values_and_attributes</a></li>
79
- </ol>
80
- </div>
81
- <div id='section'>
82
- <div id='constants-list'>
83
- <h2>Constants</h2>
84
- <div class='name-list'>
85
- <table summary='Constants'>
86
- <tr class='top-aligned-row context-row'>
87
- <td class='context-item-name'>TAG</td>
88
- <td>=</td>
89
- <td class='context-item-value'>&quot;Tag&quot;</td>
90
- <td>&nbsp;</td>
91
- <td class='context-item-desc'>
92
-
93
- <a href="Tag.html">Tag</a> datastructure tests
94
- </td>
95
- </tr>
96
- <tr class='top-aligned-row context-row'>
97
- <td class='context-item-name'>TAG_WRITE_PARSE</td>
98
- <td>=</td>
99
- <td class='context-item-value'>&quot;Tag Write Parse&quot;</td>
100
- </tr>
101
- <tr class='top-aligned-row context-row'>
102
- <td class='context-item-name'>STRING_DECLARATIONS</td>
103
- <td>=</td>
104
- <td class='context-item-value'>&quot;String Declarations&quot;</td>
105
- <td>&nbsp;</td>
106
- <td class='context-item-desc'>
107
-
108
- Basic Types Tests
109
- </td>
110
- </tr>
111
- <tr class='top-aligned-row context-row'>
112
- <td class='context-item-name'>CHARACTER_DECLARATIONS</td>
113
- <td>=</td>
114
- <td class='context-item-value'>&quot;Character Declarations&quot;</td>
115
- </tr>
116
- <tr class='top-aligned-row context-row'>
117
- <td class='context-item-name'>NUMBER_DECLARATIONS</td>
118
- <td>=</td>
119
- <td class='context-item-value'>&quot;Number Declarations&quot;</td>
120
- </tr>
121
- <tr class='top-aligned-row context-row'>
122
- <td class='context-item-name'>BOOLEAN_DECLARATIONS</td>
123
- <td>=</td>
124
- <td class='context-item-value'>&quot;Boolean Declarations&quot;</td>
125
- </tr>
126
- <tr class='top-aligned-row context-row'>
127
- <td class='context-item-name'>NULL_DECLARATION</td>
128
- <td>=</td>
129
- <td class='context-item-value'>&quot;Null Declaration&quot;</td>
130
- </tr>
131
- <tr class='top-aligned-row context-row'>
132
- <td class='context-item-name'>DATE_DECLARATIONS</td>
133
- <td>=</td>
134
- <td class='context-item-value'>&quot;Date Declarations&quot;</td>
135
- </tr>
136
- <tr class='top-aligned-row context-row'>
137
- <td class='context-item-name'>TIME_SPAN_DECLARATIONS</td>
138
- <td>=</td>
139
- <td class='context-item-value'>&quot;Time Span Declarations&quot;</td>
140
- </tr>
141
- <tr class='top-aligned-row context-row'>
142
- <td class='context-item-name'>DATE_TIME_DECLARATIONS</td>
143
- <td>=</td>
144
- <td class='context-item-value'>&quot;Date Time Declarations&quot;</td>
145
- </tr>
146
- <tr class='top-aligned-row context-row'>
147
- <td class='context-item-name'>BINARY_DECLARATIONS</td>
148
- <td>=</td>
149
- <td class='context-item-value'>&quot;Binary Declarations&quot;;</td>
150
- </tr>
151
- <tr class='top-aligned-row context-row'>
152
- <td class='context-item-name'>EMPTY_TAG</td>
153
- <td>=</td>
154
- <td class='context-item-value'>&quot;Empty Tag&quot;</td>
155
- <td>&nbsp;</td>
156
- <td class='context-item-desc'>
157
-
158
- Structure Tests
159
- </td>
160
- </tr>
161
- <tr class='top-aligned-row context-row'>
162
- <td class='context-item-name'>VALUES</td>
163
- <td>=</td>
164
- <td class='context-item-value'>&quot;Values&quot;</td>
165
- </tr>
166
- <tr class='top-aligned-row context-row'>
167
- <td class='context-item-name'>ATTRIBUTES</td>
168
- <td>=</td>
169
- <td class='context-item-value'>&quot;Attributes&quot;</td>
170
- </tr>
171
- <tr class='top-aligned-row context-row'>
172
- <td class='context-item-name'>VALUES_AND_ATTRIBUTES</td>
173
- <td>=</td>
174
- <td class='context-item-value'>&quot;Values and Attributes&quot;</td>
175
- </tr>
176
- <tr class='top-aligned-row context-row'>
177
- <td class='context-item-name'>CHILDREN</td>
178
- <td>=</td>
179
- <td class='context-item-value'>&quot;Children&quot;</td>
180
- </tr>
181
- <tr class='top-aligned-row context-row'>
182
- <td class='context-item-name'>NAMESPACES</td>
183
- <td>=</td>
184
- <td class='context-item-value'>&quot;Namespaces&quot;</td>
185
- </tr>
186
- </table>
187
- </div>
188
- </div>
189
- <div id='methods'>
190
- <h2>Public instance methods</h2>
191
- <div class='method public-instance' id='method-M000130'>
192
- <a name='M000130'></a>
193
- <div class='synopsis'>
194
- <span class='name'>assert_tags_equal</span>
195
- <span class='arguments'>(expected, actual, message)</span>
196
- </div>
197
- <div class='source'>
198
- <a class='source-toggle' href='#' onclick="toggleCode('M000130-source'); return false">
199
- [show source]
200
- </a>
201
- <pre id='M000130-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 67</span>&#x000A;67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assert_tags_equal</span>(<span class="ruby-identifier">expected</span>, <span class="ruby-identifier">actual</span>, <span class="ruby-identifier">message</span>)&#x000A;68: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">expected</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">actual</span>&#x000A;69: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">expected</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">actual</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">message</span>)&#x000A;70: <span class="ruby-keyword kw">end</span>&#x000A;71: <span class="ruby-keyword kw">end</span></pre>
202
- </div>
203
- </div>
204
- <div class='method public-instance' id='method-M000136'>
205
- <a name='M000136'></a>
206
- <div class='synopsis'>
207
- <span class='name'>check_tag_write_parse</span>
208
- <span class='arguments'>(root)</span>
209
- </div>
210
- <div class='description'>
211
- <p>
212
- Does a to_s/parse test on the specified <a href="Tag.html">Tag</a>
213
- (<tt>root</tt>)
214
- </p>
215
- </div>
216
- <div class='source'>
217
- <a class='source-toggle' href='#' onclick="toggleCode('M000136-source'); return false">
218
- [show source]
219
- </a>
220
- <pre id='M000136-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 139</span>&#x000A;139: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_tag_write_parse</span>(<span class="ruby-identifier">root</span>)&#x000A;140: <span class="ruby-comment cmt"># puts '========================================'</span>&#x000A;141: <span class="ruby-comment cmt"># puts root.to_s</span>&#x000A;142: <span class="ruby-comment cmt"># puts '========================================'</span>&#x000A;143: &#x000A;144: <span class="ruby-identifier">write_parse_root</span> = <span class="ruby-constant">Tag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;test&quot;</span>).<span class="ruby-identifier">read</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;root&quot;</span>);&#x000A;145: &#x000A;146: <span class="ruby-comment cmt"># File.open(&quot;d:\\dev\\tmp\\root.sdl&quot;, &quot;w&quot;) { |io| io.write(root.to_string) }</span>&#x000A;147: <span class="ruby-comment cmt"># File.open(&quot;d:\\dev\\tmp\\root_reparsed.sdl&quot;, &quot;w&quot;) { |io| io.write(write_parse_root.to_string) }</span>&#x000A;148: &#x000A;149: <span class="ruby-identifier">assert_tags_equal</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">write_parse_root</span>, <span class="ruby-value str">&quot;write/parse&quot;</span>)&#x000A;150: <span class="ruby-keyword kw">end</span></pre>
221
- </div>
222
- </div>
223
- <div class='method public-instance' id='method-M000131'>
224
- <a name='M000131'></a>
225
- <div class='synopsis'>
226
- <span class='name'>get_test_sdl_file_path</span>
227
- <span class='arguments'>(filename)</span>
228
- </div>
229
- <div class='description'>
230
- <p>
231
- Returns a Pathname giving the location of the specified relative
232
- <tt>filename</tt>.
233
- </p>
234
- <table>
235
- <tr><td valign="top"><tt>filename</tt>:</td><td>path to a file relatively to this source file
236
-
237
- </td></tr>
238
- </table>
239
- </div>
240
- <div class='source'>
241
- <a class='source-toggle' href='#' onclick="toggleCode('M000131-source'); return false">
242
- [show source]
243
- </a>
244
- <pre id='M000131-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 77</span>&#x000A;77: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_test_sdl_file_path</span>(<span class="ruby-identifier">filename</span>)&#x000A;78: <span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>)&#x000A;79: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dir</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">filename</span>)&#x000A;80: <span class="ruby-keyword kw">end</span></pre>
245
- </div>
246
- </div>
247
- <div class='method public-instance' id='method-M000132'>
248
- <a name='M000132'></a>
249
- <div class='synopsis'>
250
- <span class='name'>setup</span>
251
- <span class='arguments'>()</span>
252
- </div>
253
- <div class='source'>
254
- <a class='source-toggle' href='#' onclick="toggleCode('M000132-source'); return false">
255
- [show source]
256
- </a>
257
- <pre id='M000132-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 85</span>&#x000A;85: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>&#x000A;86: <span class="ruby-keyword kw">super</span>&#x000A;87: &#x000A;88: <span class="ruby-ivar">@@root_basic_types</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">SDL4R</span><span class="ruby-operator">::</span><span class="ruby-identifier">read</span>(<span class="ruby-identifier">get_test_sdl_file_path</span>(<span class="ruby-value str">&quot;test_basic_types.sdl&quot;</span>))&#x000A;89: <span class="ruby-ivar">@@root_structures</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">SDL4R</span><span class="ruby-operator">::</span><span class="ruby-identifier">read</span>(<span class="ruby-identifier">get_test_sdl_file_path</span>(<span class="ruby-value str">&quot;test_structures.sdl&quot;</span>))&#x000A;90: <span class="ruby-keyword kw">end</span></pre>
258
- </div>
259
- </div>
260
- <div class='method public-instance' id='method-M000149'>
261
- <a name='M000149'></a>
262
- <div class='synopsis'>
263
- <span class='name'>test_attributes</span>
264
- <span class='arguments'>()</span>
265
- </div>
266
- <div class='source'>
267
- <a class='source-toggle' href='#' onclick="toggleCode('M000149-source'); return false">
268
- [show source]
269
- </a>
270
- <pre id='M000149-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 400</span>&#x000A;400: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_attributes</span>&#x000A;401: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_structures</span>&#x000A;402: &#x000A;403: <span class="ruby-identifier">assert_equal</span>(&#x000A;404: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts1&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;joe&quot;</span>}, <span class="ruby-constant">ATTRIBUTES</span>);&#x000A;405: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts2&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;size&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">5</span>}, <span class="ruby-constant">ATTRIBUTES</span>);&#x000A;406: <span class="ruby-identifier">assert_equal</span>(&#x000A;407: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts3&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;joe&quot;</span>,<span class="ruby-value str">&quot;size&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">5</span>}, <span class="ruby-constant">ATTRIBUTES</span>);&#x000A;408: <span class="ruby-identifier">assert_equal</span>(&#x000A;409: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts4&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;joe&quot;</span>,<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>,<span class="ruby-value str">&quot;smoker&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>},&#x000A;410: <span class="ruby-constant">ATTRIBUTES</span>);&#x000A;411: <span class="ruby-identifier">assert_equal</span>(&#x000A;412: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts5&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;joe&quot;</span>,<span class="ruby-value str">&quot;smoker&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>}, <span class="ruby-constant">ATTRIBUTES</span>);&#x000A;413: <span class="ruby-identifier">assert_equal</span>(&#x000A;414: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts6&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;joe&quot;</span>,<span class="ruby-value str">&quot;smoker&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>}, <span class="ruby-constant">ATTRIBUTES</span>);&#x000A;415: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts7&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;joe&quot;</span>}, <span class="ruby-constant">ATTRIBUTES</span>);&#x000A;416: <span class="ruby-identifier">assert_equal</span>(&#x000A;417: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts8&quot;</span>).<span class="ruby-identifier">attributes</span>,&#x000A;418: {<span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;joe&quot;</span>,<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>,<span class="ruby-value str">&quot;smoker&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>,&#x000A;419: <span class="ruby-value str">&quot;text&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;hi&quot;</span>,<span class="ruby-value str">&quot;birthday&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-constant">Date</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1972</span>,<span class="ruby-value">5</span>,<span class="ruby-value">23</span>)},&#x000A;420: <span class="ruby-constant">ATTRIBUTES</span>);&#x000A;421: <span class="ruby-identifier">assert_equal</span>(&#x000A;422: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;atts9&quot;</span>).<span class="ruby-identifier">attribute</span>(<span class="ruby-value str">&quot;key&quot;</span>), <span class="ruby-constant">SDL4R</span><span class="ruby-operator">::</span><span class="ruby-constant">SdlBinary</span>(<span class="ruby-value str">&quot;mykey&quot;</span>), <span class="ruby-constant">ATTRIBUTES</span>)&#x000A;423: <span class="ruby-keyword kw">end</span></pre>
271
- </div>
272
- </div>
273
- <div class='method public-instance' id='method-M000146'>
274
- <a name='M000146'></a>
275
- <div class='synopsis'>
276
- <span class='name'>test_binaries</span>
277
- <span class='arguments'>()</span>
278
- </div>
279
- <div class='source'>
280
- <a class='source-toggle' href='#' onclick="toggleCode('M000146-source'); return false">
281
- [show source]
282
- </a>
283
- <pre id='M000146-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 324</span>&#x000A;324: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_binaries</span>&#x000A;325: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;326: &#x000A;327: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-constant">SDL4R</span><span class="ruby-operator">::</span><span class="ruby-constant">SdlBinary</span>(<span class="ruby-value str">&quot;hi&quot;</span>), <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;hi&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">BINARY_DECLARATIONS</span>)&#x000A;328: <span class="ruby-identifier">assert_equal</span>(&#x000A;329: <span class="ruby-constant">SDL4R</span><span class="ruby-operator">::</span><span class="ruby-constant">SdlBinary</span>(<span class="ruby-value str">&quot;hi&quot;</span>), <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;hi&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">BINARY_DECLARATIONS</span>)&#x000A;330: <span class="ruby-identifier">assert_equal</span>(&#x000A;331: <span class="ruby-constant">SdlBinary</span>.<span class="ruby-identifier">decode64</span>(&#x000A;332: <span class="ruby-value str">&quot;iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAKnRFWHRDcmVhdGlvbiBUaW1l&quot;</span> <span class="ruby-operator">+</span>&#x000A;333: <span class="ruby-value str">&quot;AERpIDQgTXJ6IDIwMDMgMDA6MjQ6MDQgKzAxMDDdSQ6OAAAAB3RJTUUH0wMEAAcllPlrJgAA&quot;</span> <span class="ruby-operator">+</span>&#x000A;334: <span class="ruby-value str">&quot;AAlwSFlzAAAK8AAACvABQqw0mAAAAARnQU1BAACxjwv8YQUAAADQSURBVHjaY2CgEDCCyZn/&quot;</span> <span class="ruby-operator">+</span>&#x000A;335: <span class="ruby-value str">&quot;3YHkDhL1ejCkM+5kgXJ2zDQmXueShwwMh9+ALWSEGcCQfhZIvHlDnAk8PAwMHBxgJtyAa7bX&quot;</span> <span class="ruby-operator">+</span>&#x000A;336: <span class="ruby-value str">&quot;UdT8/cvA8Ps3hP7zB4FBYn/+vGbweqyJaoCmpiaKASDFv35BNMBoZMzwGKKOidJYoNgAuBdm&quot;</span> <span class="ruby-operator">+</span>&#x000A;337: <span class="ruby-value str">&quot;naXQgHRKDfgagxD89w8S+iAaFICwGIHFAgjrHUczAByySAaAMEgDLBphhv7/D8EYLgDZhAxA&quot;</span> <span class="ruby-operator">+</span>&#x000A;338: <span class="ruby-value str">&quot;mkAKYYbAMMwwDAOQXYDuDXRXgDC6AR7SW8jITNQAACjZgdj4VjlqAAAAAElFTkSuQmCC&quot;</span>&#x000A;339: ),&#x000A;340: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;png&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;341: <span class="ruby-constant">BINARY_DECLARATIONS</span>)&#x000A;342: <span class="ruby-keyword kw">end</span></pre>
284
- </div>
285
- </div>
286
- <div class='method public-instance' id='method-M000141'>
287
- <a name='M000141'></a>
288
- <div class='synopsis'>
289
- <span class='name'>test_booleans</span>
290
- <span class='arguments'>()</span>
291
- </div>
292
- <div class='source'>
293
- <a class='source-toggle' href='#' onclick="toggleCode('M000141-source'); return false">
294
- [show source]
295
- </a>
296
- <pre id='M000141-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 239</span>&#x000A;239: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_booleans</span>&#x000A;240: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;241: &#x000A;242: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;light-on&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-constant">BOOLEAN_DECLARATIONS</span>)&#x000A;243: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;light-off&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-constant">BOOLEAN_DECLARATIONS</span>)&#x000A;244: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;light1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-constant">BOOLEAN_DECLARATIONS</span>)&#x000A;245: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;light2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-constant">BOOLEAN_DECLARATIONS</span>)&#x000A;246: <span class="ruby-keyword kw">end</span></pre>
297
- </div>
298
- </div>
299
- <div class='method public-instance' id='method-M000138'>
300
- <a name='M000138'></a>
301
- <div class='synopsis'>
302
- <span class='name'>test_characters</span>
303
- <span class='arguments'>()</span>
304
- </div>
305
- <div class='source'>
306
- <a class='source-toggle' href='#' onclick="toggleCode('M000138-source'); return false">
307
- [show source]
308
- </a>
309
- <pre id='M000138-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 185</span>&#x000A;185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_characters</span>&#x000A;186: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;187: &#x000A;188: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">'a'</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>)&#x000A;189: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">'A'</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>)&#x000A;190: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">'\\'</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>)&#x000A;191: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char4&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;\n&quot;</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>)&#x000A;192: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char5&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;\t&quot;</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>)&#x000A;193: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char6&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">'\''</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>)&#x000A;194: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char7&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">'&quot;'</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>)&#x000A;195: <span class="ruby-keyword kw">end</span></pre>
310
- </div>
311
- </div>
312
- <div class='method public-instance' id='method-M000139'>
313
- <a name='M000139'></a>
314
- <div class='synopsis'>
315
- <span class='name'>test_characters_unicode</span>
316
- <span class='arguments'>()</span>
317
- </div>
318
- <div class='source'>
319
- <a class='source-toggle' href='#' onclick="toggleCode('M000139-source'); return false">
320
- [show source]
321
- </a>
322
- <pre id='M000139-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 197</span>&#x000A;197: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_characters_unicode</span>&#x000A;198: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;199: &#x000A;200: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char8&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;日&quot;</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>) <span class="ruby-comment cmt"># \u65e5</span>&#x000A;201: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char9&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;여&quot;</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>) <span class="ruby-comment cmt"># \uc5ec</span>&#x000A;202: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;char10&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;з&quot;</span>, <span class="ruby-constant">CHARACTER_DECLARATIONS</span>) <span class="ruby-comment cmt"># \u0437</span>&#x000A;203: <span class="ruby-keyword kw">end</span></pre>
323
- </div>
324
- </div>
325
- <div class='method public-instance' id='method-M000151'>
326
- <a name='M000151'></a>
327
- <div class='synopsis'>
328
- <span class='name'>test_children</span>
329
- <span class='arguments'>()</span>
330
- </div>
331
- <div class='source'>
332
- <a class='source-toggle' href='#' onclick="toggleCode('M000151-source'); return false">
333
- [show source]
334
- </a>
335
- <pre id='M000151-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 482</span>&#x000A;482: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_children</span>&#x000A;483: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_structures</span>&#x000A;484: <span class="ruby-identifier">parent</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;parent&quot;</span>)&#x000A;485: &#x000A;486: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">size</span>, <span class="ruby-value">2</span>, <span class="ruby-constant">CHILDREN</span>)&#x000A;487: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">children</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">name</span>, <span class="ruby-value str">&quot;daughter&quot;</span>, <span class="ruby-constant">CHILDREN</span>)&#x000A;488: &#x000A;489: <span class="ruby-identifier">grandparent</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;grandparent&quot;</span>)&#x000A;490: &#x000A;491: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">grandparent</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">size</span>, <span class="ruby-value">2</span>, <span class="ruby-constant">CHILDREN</span>)&#x000A;492: <span class="ruby-comment cmt"># recursive fetch of children</span>&#x000A;493: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">grandparent</span>.<span class="ruby-identifier">children</span>(<span class="ruby-keyword kw">true</span>).<span class="ruby-identifier">size</span>, <span class="ruby-value">6</span>, <span class="ruby-constant">CHILDREN</span>)&#x000A;494: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">grandparent</span>.<span class="ruby-identifier">children</span>(<span class="ruby-keyword kw">true</span>, <span class="ruby-value str">&quot;son&quot;</span>).<span class="ruby-identifier">size</span>, <span class="ruby-value">2</span>, <span class="ruby-constant">CHILDREN</span>)&#x000A;495: &#x000A;496: <span class="ruby-identifier">grandparent2</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;grandparent2&quot;</span>)&#x000A;497: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">grandparent2</span>.<span class="ruby-identifier">children</span>(<span class="ruby-keyword kw">true</span>, <span class="ruby-value str">&quot;child&quot;</span>).<span class="ruby-identifier">size</span>, <span class="ruby-value">5</span>, <span class="ruby-constant">CHILDREN</span>)&#x000A;498: <span class="ruby-identifier">assert_equal</span>(&#x000A;499: <span class="ruby-identifier">grandparent2</span>.<span class="ruby-identifier">child</span>(<span class="ruby-keyword kw">true</span>, <span class="ruby-value str">&quot;daughter&quot;</span>).<span class="ruby-identifier">attribute</span>(<span class="ruby-value str">&quot;birthday&quot;</span>),&#x000A;500: <span class="ruby-constant">Date</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1976</span>,<span class="ruby-value">04</span>,<span class="ruby-value">18</span>),&#x000A;501: <span class="ruby-constant">CHILDREN</span>)&#x000A;502: &#x000A;503: <span class="ruby-identifier">files</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;files&quot;</span>)&#x000A;504: &#x000A;505: <span class="ruby-identifier">assert_equal</span>(&#x000A;506: [<span class="ruby-value str">&quot;c:/file1.txt&quot;</span>, <span class="ruby-value str">&quot;c:/file2.txt&quot;</span>, <span class="ruby-value str">&quot;c:/folder&quot;</span>],&#x000A;507: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">children_values</span>(<span class="ruby-value str">&quot;content&quot;</span>),&#x000A;508: <span class="ruby-constant">CHILDREN</span>)&#x000A;509: &#x000A;510: <span class="ruby-identifier">matrix</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;matrix&quot;</span>)&#x000A;511: &#x000A;512: <span class="ruby-identifier">assert_equal</span>([[<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">3</span>],[<span class="ruby-value">4</span>,<span class="ruby-value">5</span>,<span class="ruby-value">6</span>]], <span class="ruby-identifier">matrix</span>.<span class="ruby-identifier">children_values</span>(<span class="ruby-value str">&quot;content&quot;</span>), <span class="ruby-constant">CHILDREN</span>);&#x000A;513: <span class="ruby-keyword kw">end</span></pre>
336
- </div>
337
- </div>
338
- <div class='method public-instance' id='method-M000145'>
339
- <a name='M000145'></a>
340
- <div class='synopsis'>
341
- <span class='name'>test_date_times</span>
342
- <span class='arguments'>()</span>
343
- </div>
344
- <div class='source'>
345
- <a class='source-toggle' href='#' onclick="toggleCode('M000145-source'); return false">
346
- [show source]
347
- </a>
348
- <pre id='M000145-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 300</span>&#x000A;300: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_date_times</span>&#x000A;301: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;302: <span class="ruby-identifier">local_offset</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">offset</span>&#x000A;303: &#x000A;304: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date_time1&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;305: <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">2005</span>,<span class="ruby-value">12</span>,<span class="ruby-value">31</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">0</span>, <span class="ruby-identifier">local_offset</span>), <span class="ruby-constant">DATE_TIME_DECLARATIONS</span>)&#x000A;306: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date_time2&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;307: <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1882</span>,<span class="ruby-value">5</span>,<span class="ruby-value">2</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">0</span>, <span class="ruby-identifier">local_offset</span>), <span class="ruby-constant">DATE_TIME_DECLARATIONS</span>)&#x000A;308: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date_time3&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;309: <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">2005</span>,<span class="ruby-value">12</span>,<span class="ruby-value">31</span>,<span class="ruby-value">1</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>, <span class="ruby-identifier">local_offset</span>), <span class="ruby-constant">DATE_TIME_DECLARATIONS</span>)&#x000A;310: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date_time4&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;311: <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1882</span>,<span class="ruby-value">5</span>,<span class="ruby-value">2</span>,<span class="ruby-value">1</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>, <span class="ruby-identifier">local_offset</span>), <span class="ruby-constant">DATE_TIME_DECLARATIONS</span>)&#x000A;312: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date_time5&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;313: <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">2005</span>,<span class="ruby-value">12</span>,<span class="ruby-value">31</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">2312</span>.<span class="ruby-identifier">to_r</span><span class="ruby-operator">/</span><span class="ruby-value">100</span>, <span class="ruby-identifier">local_offset</span>), <span class="ruby-constant">DATE_TIME_DECLARATIONS</span>)&#x000A;314: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date_time6&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;315: <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1882</span>,<span class="ruby-value">5</span>,<span class="ruby-value">2</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23123</span>.<span class="ruby-identifier">to_r</span><span class="ruby-operator">/</span><span class="ruby-value">1000</span>, <span class="ruby-identifier">local_offset</span>), <span class="ruby-constant">DATE_TIME_DECLARATIONS</span>)&#x000A;316: &#x000A;317: <span class="ruby-comment cmt"># Checking timezones...</span>&#x000A;318: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date_time7&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;319: <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1882</span>,<span class="ruby-value">5</span>,<span class="ruby-value">2</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23123</span>.<span class="ruby-identifier">to_r</span><span class="ruby-operator">/</span><span class="ruby-value">1000</span>,<span class="ruby-value str">&quot;JST&quot;</span>), <span class="ruby-constant">DATE_TIME_DECLARATIONS</span>)&#x000A;320: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date_time8&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;321: <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">985</span>,<span class="ruby-value">04</span>,<span class="ruby-value">11</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23123</span>.<span class="ruby-identifier">to_r</span><span class="ruby-operator">/</span><span class="ruby-value">1000</span>,<span class="ruby-value str">&quot;PST&quot;</span>), <span class="ruby-constant">DATE_TIME_DECLARATIONS</span>)&#x000A;322: <span class="ruby-keyword kw">end</span></pre>
349
- </div>
350
- </div>
351
- <div class='method public-instance' id='method-M000143'>
352
- <a name='M000143'></a>
353
- <div class='synopsis'>
354
- <span class='name'>test_dates</span>
355
- <span class='arguments'>()</span>
356
- </div>
357
- <div class='source'>
358
- <a class='source-toggle' href='#' onclick="toggleCode('M000143-source'); return false">
359
- [show source]
360
- </a>
361
- <pre id='M000143-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 254</span>&#x000A;254: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_dates</span>&#x000A;255: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;256: &#x000A;257: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">Date</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">2005</span>, <span class="ruby-value">12</span>, <span class="ruby-value">31</span>), <span class="ruby-constant">DATE_DECLARATIONS</span>)&#x000A;258: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">Date</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1882</span>, <span class="ruby-value">5</span>, <span class="ruby-value">2</span>), <span class="ruby-constant">DATE_DECLARATIONS</span>)&#x000A;259: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;date3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">Date</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1882</span>, <span class="ruby-value">5</span>, <span class="ruby-value">2</span>), <span class="ruby-constant">DATE_DECLARATIONS</span>)&#x000A;260: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;_way_back&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">Date</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">582</span>, <span class="ruby-value">9</span>, <span class="ruby-value">16</span>), <span class="ruby-constant">DATE_DECLARATIONS</span>)&#x000A;261: <span class="ruby-keyword kw">end</span></pre>
362
- </div>
363
- </div>
364
- <div class='method public-instance' id='method-M000147'>
365
- <a name='M000147'></a>
366
- <div class='synopsis'>
367
- <span class='name'>test_empty_tag</span>
368
- <span class='arguments'>()</span>
369
- </div>
370
- <div class='description'>
371
- <p>
372
- Structure Tests (values, attributes, children)
373
- </p>
374
- </div>
375
- <div class='source'>
376
- <a class='source-toggle' href='#' onclick="toggleCode('M000147-source'); return false">
377
- [show source]
378
- </a>
379
- <pre id='M000147-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 348</span>&#x000A;348: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_empty_tag</span>&#x000A;349: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_structures</span>&#x000A;350: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;empty_tag&quot;</span>), <span class="ruby-constant">Tag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;empty_tag&quot;</span>), <span class="ruby-constant">EMPTY_TAG</span>)&#x000A;351: <span class="ruby-keyword kw">end</span></pre>
380
- </div>
381
- </div>
382
- <div class='method public-instance' id='method-M000152'>
383
- <a name='M000152'></a>
384
- <div class='synopsis'>
385
- <span class='name'>test_namespaces</span>
386
- <span class='arguments'>()</span>
387
- </div>
388
- <div class='source'>
389
- <a class='source-toggle' href='#' onclick="toggleCode('M000152-source'); return false">
390
- [show source]
391
- </a>
392
- <pre id='M000152-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 515</span>&#x000A;515: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_namespaces</span>&#x000A;516: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_structures</span>&#x000A;517: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-value">8</span>, <span class="ruby-identifier">root</span>.<span class="ruby-identifier">children</span>(<span class="ruby-keyword kw">true</span>, <span class="ruby-value str">&quot;person&quot;</span>, <span class="ruby-keyword kw">nil</span>).<span class="ruby-identifier">size</span>, <span class="ruby-constant">NAMESPACES</span>);&#x000A;518: &#x000A;519: <span class="ruby-identifier">grandparent2</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;grandparent3&quot;</span>);&#x000A;520: &#x000A;521: <span class="ruby-comment cmt"># get only the attributes for Akiko in the public namespace</span>&#x000A;522: <span class="ruby-identifier">assert_equal</span>(&#x000A;523: <span class="ruby-identifier">grandparent2</span>.<span class="ruby-identifier">child</span>(<span class="ruby-keyword kw">true</span>, <span class="ruby-value str">&quot;daughter&quot;</span>).<span class="ruby-identifier">attributes</span>(<span class="ruby-value str">&quot;public&quot;</span>),&#x000A;524: {<span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;Akiko&quot;</span>, <span class="ruby-value str">&quot;birthday&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-constant">Date</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1976</span>,<span class="ruby-value">04</span>,<span class="ruby-value">18</span>)},&#x000A;525: <span class="ruby-constant">NAMESPACES</span>);&#x000A;526: <span class="ruby-keyword kw">end</span></pre>
393
- </div>
394
- </div>
395
- <div class='method public-instance' id='method-M000142'>
396
- <a name='M000142'></a>
397
- <div class='synopsis'>
398
- <span class='name'>test_null</span>
399
- <span class='arguments'>()</span>
400
- </div>
401
- <div class='source'>
402
- <a class='source-toggle' href='#' onclick="toggleCode('M000142-source'); return false">
403
- [show source]
404
- </a>
405
- <pre id='M000142-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 248</span>&#x000A;248: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_null</span>&#x000A;249: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;250: &#x000A;251: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;nothing&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-constant">NULL_DECLARATION</span>);&#x000A;252: <span class="ruby-keyword kw">end</span></pre>
406
- </div>
407
- </div>
408
- <div class='method public-instance' id='method-M000140'>
409
- <a name='M000140'></a>
410
- <div class='synopsis'>
411
- <span class='name'>test_numbers</span>
412
- <span class='arguments'>()</span>
413
- </div>
414
- <div class='source'>
415
- <a class='source-toggle' href='#' onclick="toggleCode('M000140-source'); return false">
416
- [show source]
417
- </a>
418
- <pre id='M000140-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 205</span>&#x000A;205: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_numbers</span>&#x000A;206: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;207: &#x000A;208: <span class="ruby-comment cmt"># Testing ints...</span>&#x000A;209: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;int1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">0</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;210: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;int2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">5</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;211: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;int3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">-100</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;212: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;int4&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">234253532</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;213: &#x000A;214: <span class="ruby-comment cmt"># Testing longs...</span>&#x000A;215: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;long1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">0</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;216: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;long2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">5</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;217: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;long3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">5</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;218: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;long4&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">3904857398753453453</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;219: &#x000A;220: <span class="ruby-comment cmt"># Testing floats...</span>&#x000A;221: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;float1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">1</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;222: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;float2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">0</span><span class="ruby-value">.23</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;223: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;float3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">-0</span><span class="ruby-value">.34</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;224: &#x000A;225: <span class="ruby-comment cmt"># Testing doubles...&quot;</span>&#x000A;226: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;double1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">2</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;227: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;double2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">-0</span><span class="ruby-value">.234</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;228: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;double3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">2.34</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>)&#x000A;229: &#x000A;230: <span class="ruby-comment cmt"># Testing decimals (BigDouble in Java)...</span>&#x000A;231: <span class="ruby-identifier">assert_equal</span>(&#x000A;232: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;decimal1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">0</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>);&#x000A;233: <span class="ruby-identifier">assert_equal</span>(&#x000A;234: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;decimal2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">11.111111</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>);&#x000A;235: <span class="ruby-identifier">assert_equal</span>(&#x000A;236: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;decimal3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value">234535.3453453453454345345341242343</span>, <span class="ruby-constant">NUMBER_DECLARATIONS</span>);&#x000A;237: <span class="ruby-keyword kw">end</span></pre>
419
- </div>
420
- </div>
421
- <div class='method public-instance' id='method-M000137'>
422
- <a name='M000137'></a>
423
- <div class='synopsis'>
424
- <span class='name'>test_strings</span>
425
- <span class='arguments'>()</span>
426
- </div>
427
- <div class='description'>
428
- <p>
429
- Basic Types Tests
430
- </p>
431
- </div>
432
- <div class='source'>
433
- <a class='source-toggle' href='#' onclick="toggleCode('M000137-source'); return false">
434
- [show source]
435
- </a>
436
- <pre id='M000137-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 156</span>&#x000A;156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_strings</span>&#x000A;157: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;158: &#x000A;159: <span class="ruby-comment cmt"># Doing String tests...</span>&#x000A;160: <span class="ruby-comment cmt"># Doing basic tests including new line handling...</span>&#x000A;161: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;hello&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;162: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;hi&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;163: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;aloha&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;164: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string4&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;hi there&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;165: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string5&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;hi there joe&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;166: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string6&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;line1\nline2&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;167: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string7&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;line1\nline2&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;168: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string8&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;line1\nline2\nline3&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;169: <span class="ruby-identifier">assert_equal</span>(&#x000A;170: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string9&quot;</span>).<span class="ruby-identifier">value</span>,&#x000A;171: <span class="ruby-value str">&quot;Anything should go in this line without escapes \\ \\\\ \\n &quot;</span> <span class="ruby-operator">+</span>&#x000A;172: <span class="ruby-value str">&quot;\\t \&quot; \&quot;\&quot; ' ''&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;173: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;string10&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;escapes \&quot;\\\n\t&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;174: &#x000A;175: <span class="ruby-comment cmt"># Checking unicode strings...</span>&#x000A;176: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;japanese.hello&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;日本語&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;177: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;korean.hello&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;여보세요&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;178: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;russian.hello&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;здравствулте&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;179: &#x000A;180: <span class="ruby-comment cmt"># More new line tests...</span>&#x000A;181: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;xml&quot;</span>).<span class="ruby-identifier">value</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">&quot;&lt;text&gt;Hi there!&lt;/text&gt;&quot;</span>) <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;182: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;line_test&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-value str">&quot;\nnew line above and below\n&quot;</span>, <span class="ruby-constant">STRING_DECLARATIONS</span>)&#x000A;183: <span class="ruby-keyword kw">end</span></pre>
437
- </div>
438
- </div>
439
- <div class='method public-instance' id='method-M000133'>
440
- <a name='M000133'></a>
441
- <div class='synopsis'>
442
- <span class='name'>test_tag</span>
443
- <span class='arguments'>()</span>
444
- </div>
445
- <div class='description'>
446
- <p>
447
- <a href="Tag.html">Tag</a> Tests
448
- </p>
449
- </div>
450
- <div class='source'>
451
- <a class='source-toggle' href='#' onclick="toggleCode('M000133-source'); return false">
452
- [show source]
453
- </a>
454
- <pre id='M000133-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 95</span>&#x000A; 95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_tag</span>&#x000A; 96: <span class="ruby-comment cmt"># Test to make sure Tag ignores the order in which attributes are</span>&#x000A; 97: <span class="ruby-comment cmt"># added.</span>&#x000A; 98: <span class="ruby-identifier">t1</span> = <span class="ruby-constant">Tag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;test&quot;</span>)&#x000A; 99: <span class="ruby-identifier">t1</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;foo&quot;</span>, <span class="ruby-value str">&quot;bar&quot;</span>)&#x000A;100: <span class="ruby-identifier">t1</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;john&quot;</span>, <span class="ruby-value str">&quot;doe&quot;</span>)&#x000A;101: &#x000A;102: <span class="ruby-identifier">t2</span> = <span class="ruby-constant">Tag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;test&quot;</span>)&#x000A;103: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;john&quot;</span>, <span class="ruby-value str">&quot;doe&quot;</span>)&#x000A;104: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;foo&quot;</span>, <span class="ruby-value str">&quot;bar&quot;</span>)&#x000A;105: &#x000A;106: <span class="ruby-identifier">assert_tags_equal</span>(<span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span>, <span class="ruby-constant">TAG</span>)&#x000A;107: &#x000A;108: <span class="ruby-comment cmt"># Making sure tags with different structures return false from .equals</span>&#x000A;109: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">value</span> = <span class="ruby-value str">&quot;item&quot;</span>&#x000A;110: <span class="ruby-identifier">assert_not_equal</span>(<span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span>, <span class="ruby-constant">TAG</span>)&#x000A;111: &#x000A;112: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">remove_value</span>(<span class="ruby-value str">&quot;item&quot;</span>)&#x000A;113: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;another&quot;</span>, <span class="ruby-value str">&quot;attribute&quot;</span>)&#x000A;114: <span class="ruby-identifier">assert_not_equal</span>(<span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span>, <span class="ruby-constant">TAG</span>)&#x000A;115: &#x000A;116: <span class="ruby-comment cmt"># Checking attributes namespaces</span>&#x000A;117: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;name&quot;</span>, <span class="ruby-value str">&quot;bill&quot;</span>)&#x000A;118: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;private&quot;</span>, <span class="ruby-value str">&quot;smoker&quot;</span>, <span class="ruby-keyword kw">true</span>)&#x000A;119: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;public&quot;</span>, <span class="ruby-value str">&quot;hobby&quot;</span>, <span class="ruby-value str">&quot;hiking&quot;</span>)&#x000A;120: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">set_attribute</span>(<span class="ruby-value str">&quot;private&quot;</span>, <span class="ruby-value str">&quot;nickname&quot;</span>, <span class="ruby-value str">&quot;tubby&quot;</span>)&#x000A;121: &#x000A;122: <span class="ruby-identifier">assert_equal</span>(&#x000A;123: <span class="ruby-identifier">t2</span>.<span class="ruby-identifier">attributes</span>(<span class="ruby-value str">&quot;private&quot;</span>),&#x000A;124: { <span class="ruby-value str">&quot;smoker&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-value str">&quot;nickname&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;tubby&quot;</span> },&#x000A;125: <span class="ruby-value str">&quot;attributes()&quot;</span>)&#x000A;126: <span class="ruby-keyword kw">end</span></pre>
455
- </div>
456
- </div>
457
- <div class='method public-instance' id='method-M000134'>
458
- <a name='M000134'></a>
459
- <div class='synopsis'>
460
- <span class='name'>test_tag_write_parse_basic_types</span>
461
- <span class='arguments'>()</span>
462
- </div>
463
- <div class='source'>
464
- <a class='source-toggle' href='#' onclick="toggleCode('M000134-source'); return false">
465
- [show source]
466
- </a>
467
- <pre id='M000134-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 128</span>&#x000A;128: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_tag_write_parse_basic_types</span>&#x000A;129: <span class="ruby-identifier">check_tag_write_parse</span> <span class="ruby-ivar">@@root_basic_types</span>&#x000A;130: <span class="ruby-keyword kw">end</span></pre>
468
- </div>
469
- </div>
470
- <div class='method public-instance' id='method-M000135'>
471
- <a name='M000135'></a>
472
- <div class='synopsis'>
473
- <span class='name'>test_tag_write_parse_structures</span>
474
- <span class='arguments'>()</span>
475
- </div>
476
- <div class='source'>
477
- <a class='source-toggle' href='#' onclick="toggleCode('M000135-source'); return false">
478
- [show source]
479
- </a>
480
- <pre id='M000135-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 132</span>&#x000A;132: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_tag_write_parse_structures</span>&#x000A;133: <span class="ruby-identifier">check_tag_write_parse</span> <span class="ruby-ivar">@@root_structures</span>&#x000A;134: <span class="ruby-keyword kw">end</span></pre>
481
- </div>
482
- </div>
483
- <div class='method public-instance' id='method-M000144'>
484
- <a name='M000144'></a>
485
- <div class='synopsis'>
486
- <span class='name'>test_time_spans</span>
487
- <span class='arguments'>()</span>
488
- </div>
489
- <div class='source'>
490
- <a class='source-toggle' href='#' onclick="toggleCode('M000144-source'); return false">
491
- [show source]
492
- </a>
493
- <pre id='M000144-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 263</span>&#x000A;263: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_time_spans</span>&#x000A;264: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_basic_types</span>&#x000A;265: &#x000A;266: <span class="ruby-identifier">assert_equal</span>(&#x000A;267: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time1&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;268: <span class="ruby-identifier">assert_equal</span>(&#x000A;269: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time2&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">24</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;270: <span class="ruby-identifier">assert_equal</span>(&#x000A;271: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time3&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">1</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;272: <span class="ruby-identifier">assert_equal</span>(&#x000A;273: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time4&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">1</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;274: <span class="ruby-identifier">assert_equal</span>(&#x000A;275: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time5&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">2</span>,<span class="ruby-value">0</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;276: <span class="ruby-identifier">assert_equal</span>(&#x000A;277: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time6&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23</span>,<span class="ruby-value">0</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;278: <span class="ruby-identifier">assert_equal</span>(&#x000A;279: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time7&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23</span>,<span class="ruby-value">100</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;280: <span class="ruby-identifier">assert_equal</span>(&#x000A;281: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time8&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23</span>,<span class="ruby-value">120</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;282: <span class="ruby-identifier">assert_equal</span>(&#x000A;283: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time9&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23</span>,<span class="ruby-value">123</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;284: &#x000A;285: <span class="ruby-comment cmt"># Checking time spans with days...</span>&#x000A;286: <span class="ruby-identifier">assert_equal</span>(&#x000A;287: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time10&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">34</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23</span>,<span class="ruby-value">100</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;288: <span class="ruby-identifier">assert_equal</span>(&#x000A;289: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time11&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">1</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;290: <span class="ruby-identifier">assert_equal</span>(&#x000A;291: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time12&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">5</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">23</span>,<span class="ruby-value">123</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;292: &#x000A;293: <span class="ruby-comment cmt"># Checking negative time spans...</span>&#x000A;294: <span class="ruby-identifier">assert_equal</span>(&#x000A;295: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time13&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">-12</span>,<span class="ruby-value">-30</span>,<span class="ruby-value">-23</span>,<span class="ruby-value">-123</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;296: <span class="ruby-identifier">assert_equal</span>(&#x000A;297: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;time14&quot;</span>).<span class="ruby-identifier">value</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">-5</span>,<span class="ruby-value">-12</span>,<span class="ruby-value">-30</span>,<span class="ruby-value">-23</span>,<span class="ruby-value">-123</span>), <span class="ruby-constant">TIME_SPAN_DECLARATIONS</span>)&#x000A;298: <span class="ruby-keyword kw">end</span></pre>
494
- </div>
495
- </div>
496
- <div class='method public-instance' id='method-M000148'>
497
- <a name='M000148'></a>
498
- <div class='synopsis'>
499
- <span class='name'>test_values</span>
500
- <span class='arguments'>()</span>
501
- </div>
502
- <div class='source'>
503
- <a class='source-toggle' href='#' onclick="toggleCode('M000148-source'); return false">
504
- [show source]
505
- </a>
506
- <pre id='M000148-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 353</span>&#x000A;353: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_values</span>&#x000A;354: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_structures</span>&#x000A;355: <span class="ruby-identifier">local_offset</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">offset</span>&#x000A;356: &#x000A;357: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values1&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;hi&quot;</span>], <span class="ruby-constant">VALUES</span>)&#x000A;358: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values2&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;hi&quot;</span>,<span class="ruby-value str">&quot;ho&quot;</span>], <span class="ruby-constant">VALUES</span>)&#x000A;359: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values3&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>, <span class="ruby-value str">&quot;ho&quot;</span>], <span class="ruby-constant">VALUES</span>)&#x000A;360: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values4&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;hi&quot;</span>,<span class="ruby-value">5</span>], <span class="ruby-constant">VALUES</span>)&#x000A;361: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values5&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">2</span>], <span class="ruby-constant">VALUES</span>)&#x000A;362: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values6&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">3</span>], <span class="ruby-constant">VALUES</span>)&#x000A;363: <span class="ruby-identifier">assert_equal</span>(&#x000A;364: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values7&quot;</span>).<span class="ruby-identifier">values</span>,&#x000A;365: [<span class="ruby-keyword kw">nil</span>,<span class="ruby-value str">&quot;foo&quot;</span>,<span class="ruby-keyword kw">false</span>,<span class="ruby-constant">Date</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1980</span>,<span class="ruby-value">12</span>,<span class="ruby-value">5</span>)],&#x000A;366: <span class="ruby-constant">VALUES</span>)&#x000A;367: <span class="ruby-identifier">assert_equal</span>(&#x000A;368: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values8&quot;</span>).<span class="ruby-identifier">values</span>,&#x000A;369: [<span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;foo&quot;</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1980</span>,<span class="ruby-value">12</span>,<span class="ruby-value">5</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">0</span>,<span class="ruby-identifier">local_offset</span>),&#x000A;370: <span class="ruby-value str">&quot;there&quot;</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">15</span>,<span class="ruby-value">23</span>,<span class="ruby-value">12</span>,<span class="ruby-value">234</span>)],&#x000A;371: <span class="ruby-constant">VALUES</span>)&#x000A;372: <span class="ruby-identifier">assert_equal</span>(&#x000A;373: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values9&quot;</span>).<span class="ruby-identifier">values</span>,&#x000A;374: [<span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;foo&quot;</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1980</span>,<span class="ruby-value">12</span>,<span class="ruby-value">5</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">0</span>,<span class="ruby-identifier">local_offset</span>),&#x000A;375: <span class="ruby-value str">&quot;there&quot;</span>, <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1989</span>,<span class="ruby-value">8</span>,<span class="ruby-value">12</span>,<span class="ruby-value">15</span>,<span class="ruby-value">23</span>,<span class="ruby-value">12234</span>.<span class="ruby-identifier">to_r</span><span class="ruby-operator">/</span><span class="ruby-value">1000</span>,<span class="ruby-value str">&quot;JST&quot;</span>)],&#x000A;376: <span class="ruby-constant">VALUES</span>)&#x000A;377: <span class="ruby-identifier">assert_equal</span>(&#x000A;378: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values10&quot;</span>).<span class="ruby-identifier">values</span>,&#x000A;379: [<span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;foo&quot;</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1980</span>,<span class="ruby-value">12</span>,<span class="ruby-value">5</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">0</span>,<span class="ruby-identifier">local_offset</span>),&#x000A;380: <span class="ruby-value str">&quot;there&quot;</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>,<span class="ruby-value">15</span>,<span class="ruby-value">23</span>,<span class="ruby-value">12</span>,<span class="ruby-value">234</span>), <span class="ruby-value str">&quot;more stuff&quot;</span>],&#x000A;381: <span class="ruby-constant">VALUES</span>)&#x000A;382: <span class="ruby-identifier">assert_equal</span>(&#x000A;383: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values11&quot;</span>).<span class="ruby-identifier">values</span>,&#x000A;384: [<span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;foo&quot;</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1980</span>,<span class="ruby-value">12</span>,<span class="ruby-value">5</span>,<span class="ruby-value">12</span>,<span class="ruby-value">30</span>,<span class="ruby-value">0</span>,<span class="ruby-identifier">local_offset</span>),&#x000A;385: <span class="ruby-value str">&quot;there&quot;</span>, <span class="ruby-constant">SdlTimeSpan</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">123</span>,<span class="ruby-value">15</span>,<span class="ruby-value">23</span>,<span class="ruby-value">12</span>,<span class="ruby-value">234</span>), <span class="ruby-value str">&quot;more stuff here&quot;</span>],&#x000A;386: <span class="ruby-constant">VALUES</span>)&#x000A;387: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values12&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">3</span>], <span class="ruby-constant">VALUES</span>)&#x000A;388: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values13&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">3</span>], <span class="ruby-constant">VALUES</span>)&#x000A;389: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values14&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">3</span>], <span class="ruby-constant">VALUES</span>)&#x000A;390: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values15&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">4</span>,<span class="ruby-value">5</span>,<span class="ruby-value">6</span>], <span class="ruby-constant">VALUES</span>)&#x000A;391: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values16&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">5</span>], <span class="ruby-constant">VALUES</span>)&#x000A;392: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values17&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">5</span>], <span class="ruby-constant">VALUES</span>)&#x000A;393: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values18&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">7</span>], <span class="ruby-constant">VALUES</span>)&#x000A;394: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values19&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">3</span>,<span class="ruby-value">5</span>,<span class="ruby-value">7</span>], <span class="ruby-constant">VALUES</span>)&#x000A;395: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values20&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">3</span>,<span class="ruby-value">5</span>], <span class="ruby-constant">VALUES</span>)&#x000A;396: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values21&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value">1</span>,<span class="ruby-value">3</span>,<span class="ruby-value">5</span>], <span class="ruby-constant">VALUES</span>)&#x000A;397: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;values22&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;hi&quot;</span>,<span class="ruby-value str">&quot;ho&quot;</span>,<span class="ruby-value str">&quot;ho&quot;</span>,<span class="ruby-value">5</span>,<span class="ruby-value str">&quot;hi&quot;</span>], <span class="ruby-constant">VALUES</span>)&#x000A;398: <span class="ruby-keyword kw">end</span></pre>
507
- </div>
508
- </div>
509
- <div class='method public-instance' id='method-M000150'>
510
- <a name='M000150'></a>
511
- <div class='synopsis'>
512
- <span class='name'>test_values_and_attributes</span>
513
- <span class='arguments'>()</span>
514
- </div>
515
- <div class='source'>
516
- <a class='source-toggle' href='#' onclick="toggleCode('M000150-source'); return false">
517
- [show source]
518
- </a>
519
- <pre id='M000150-source'> <span class="ruby-comment cmt"># File test/sdl4r/sdl4r_test.rb, line 425</span>&#x000A;425: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_values_and_attributes</span>&#x000A;426: <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@@root_structures</span>&#x000A;427: &#x000A;428: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts1&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;joe&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;429: <span class="ruby-identifier">assert_equal</span>(&#x000A;430: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts1&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>}, <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;431: &#x000A;432: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts2&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;joe&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;433: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts2&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>}, <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;434: &#x000A;435: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts3&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;joe&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;436: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts3&quot;</span>).<span class="ruby-identifier">attributes</span>, {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>}, <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;437: &#x000A;438: <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts4&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;joe&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;439: <span class="ruby-identifier">assert_equal</span>(&#x000A;440: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts4&quot;</span>).<span class="ruby-identifier">attributes</span>,&#x000A;441: {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>, <span class="ruby-value str">&quot;weight&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">160</span>, <span class="ruby-value str">&quot;hat&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;big&quot;</span>},&#x000A;442: <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;443: &#x000A;444: <span class="ruby-identifier">assert_equal</span>(&#x000A;445: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts5&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;joe&quot;</span>, <span class="ruby-value str">&quot;is a\n nice guy&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;446: <span class="ruby-identifier">assert_equal</span>(&#x000A;447: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts5&quot;</span>).<span class="ruby-identifier">attributes</span>,&#x000A;448: {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>, <span class="ruby-value str">&quot;smoker&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>},&#x000A;449: <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>);&#x000A;450: &#x000A;451: <span class="ruby-identifier">assert_equal</span>(&#x000A;452: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts6&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;joe&quot;</span>, <span class="ruby-value str">&quot;is a\n nice guy&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;453: <span class="ruby-identifier">assert_equal</span>(&#x000A;454: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts6&quot;</span>).<span class="ruby-identifier">attributes</span>,&#x000A;455: {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>, <span class="ruby-value str">&quot;house&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;big and\n blue&quot;</span>},&#x000A;456: <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;457: &#x000A;458: <span class="ruby-comment cmt">#####</span>&#x000A;459: &#x000A;460: <span class="ruby-identifier">assert_equal</span>(&#x000A;461: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts7&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;joe&quot;</span>, <span class="ruby-value str">&quot;is a\n nice guy&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;462: <span class="ruby-identifier">assert_equal</span>(&#x000A;463: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts7&quot;</span>).<span class="ruby-identifier">attributes</span>,&#x000A;464: {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>, <span class="ruby-value str">&quot;smoker&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>},&#x000A;465: <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;466: &#x000A;467: <span class="ruby-identifier">assert_equal</span>(&#x000A;468: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts8&quot;</span>).<span class="ruby-identifier">values</span>, [<span class="ruby-value str">&quot;joe&quot;</span>, <span class="ruby-value str">&quot;is a\n nice guy&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;469: <span class="ruby-identifier">assert_equal</span>(&#x000A;470: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts8&quot;</span>).<span class="ruby-identifier">attributes</span>,&#x000A;471: {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>, <span class="ruby-value str">&quot;smoker&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>},&#x000A;472: <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>);&#x000A;473: &#x000A;474: <span class="ruby-identifier">assert_equal</span>(&#x000A;475: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts9&quot;</span>).<span class="ruby-identifier">values</span>,[<span class="ruby-value str">&quot;joe&quot;</span>, <span class="ruby-value str">&quot;is a\n nice guy&quot;</span>], <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;476: <span class="ruby-identifier">assert_equal</span>(&#x000A;477: <span class="ruby-identifier">root</span>.<span class="ruby-identifier">child</span>(<span class="ruby-value str">&quot;valatts9&quot;</span>).<span class="ruby-identifier">attributes</span>,&#x000A;478: {<span class="ruby-value str">&quot;size&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">5</span>, <span class="ruby-value str">&quot;smoker&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>},&#x000A;479: <span class="ruby-constant">VALUES_AND_ATTRIBUTES</span>)&#x000A;480: <span class="ruby-keyword kw">end</span></pre>
520
- </div>
521
- </div>
522
- </div>
523
- </div>
524
- </div>
525
- </div>
526
- <div id='footer-push'></div>
527
- </div>
528
- <div id='footer'>
529
- <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
530
- </div>
531
- </body>
532
- </html>