|
30 | 30 |
|
31 | 31 | ## General instructions for running the JSON-LD Test suites |
32 | 32 |
|
33 | | - - if manifest['sequence'].first.is_a?(String) || manifest['sequence'].any? {|te| te['@type'].include?('jld:CompactTest')} |
| 33 | + - if ( manifest['inclusion'] && manifest['inclusion'].first.is_a?(String) ) || ( manifest['sequence'] && manifest['sequence'].any? {|te| te['@type'].include?('jld:CompactTest')} ) |
34 | 34 | :markdown |
35 | 35 | ### [compact](compact-manifest.html) tests have _input_, _expected_ and _context_ documents. |
36 | 36 |
|
37 | 37 | The _expected_ results can be compared using [JSON-LD object comparison](#json-ld-object-comparison) with the processor output. Additionally, if the `ordered` option is not set, result should be expanded and compared with the expanded _expected_ document also using [JSON-LD object comparison](#json-ld-object-comparison). |
38 | 38 |
|
39 | 39 | For **NegativeEvaluationTests**, the result is a string associated with the expected error code. |
40 | 40 |
|
41 | | - - if manifest['sequence'].first.is_a?(String) || manifest['sequence'].any? {|te| te['@type'].include?('jld:ExpandTest')} |
| 41 | + - if ( manifest['inclusion'] && manifest['inclusion'].first.is_a?(String) ) || ( manifest['sequence'] && manifest['sequence'].any? {|te| te['@type'].include?('jld:ExpandTest')} ) |
42 | 42 | :markdown |
43 | 43 | ### [expand](expand-manifest.html) tests have _input_ and _expected_ documents. |
44 | 44 |
|
|
49 | 49 |
|
50 | 50 | For **NegativeEvaluationTests**, the result is a string associated with the expected error code. |
51 | 51 |
|
52 | | - - if manifest['sequence'].first.is_a?(String) || manifest['sequence'].any? {|te| te['@type'].include?('jld:HtmlTest')} |
| 52 | + - if ( manifest['inclusion'] && manifest['inclusion'].first.is_a?(String) ) || ( manifest['sequence'] && manifest['sequence'].any? {|te| te['@type'].include?('jld:HtmlTest')} ) |
53 | 53 | :markdown |
54 | 54 | ### [html](html-manifest.html) tests have _input_ and _expected_ documents and an optional _context_ document. |
55 | 55 |
|
56 | 56 | The _expected_ results can be compared using [JSON-LD object comparison](#json-ld-object-comparison) with the processor output after potentially remapping blank node identifiers (see below). Additionally, if the result is compacted and the `ordered` option is not set, result should be expanded and compared with the expanded _expected_ document also using [JSON-LD object comparison](#json-ld-object-comparison). |
57 | 57 |
|
58 | 58 | For **NegativeEvaluationTests**, the result is a string associated with the expected error code. |
59 | 59 |
|
60 | | - - if manifest['sequence'].first.is_a?(String) || manifest['sequence'].any? {|te| te['@type'].include?('jld:FlattenTest')} |
| 60 | + - if ( manifest['inclusion'] && manifest['inclusion'].first.is_a?(String) ) || ( manifest['sequence'] && manifest['sequence'].any? {|te| te['@type'].include?('jld:FlattenTest')} ) |
61 | 61 | :markdown |
62 | 62 | ### [flatten](flatten-manifest.html) tests have _input_ and _expected_ documents and an optional _context_ document. |
63 | 63 |
|
64 | 64 | The _expected_ results can be compared using [JSON-LD object comparison](#json-ld-object-comparison) with the processor output after potentially remapping blank node identifiers (see below). Additionally, if the result is compacted and the `ordered` option is not set, result should be expanded and compared with the expanded _expected_ document also using [JSON-LD object comparison](#json-ld-object-comparison). |
65 | 65 |
|
66 | 66 | For **NegativeEvaluationTests**, the result is a string associated with the expected error code. |
67 | 67 |
|
68 | | - - if manifest['sequence'].first.is_a?(String) || manifest['name'].include?('Remote') |
| 68 | + - if ( manifest['inclusion'] && manifest['inclusion'].first.is_a?(String) ) || ( manifest['name'].include?('Remote') ) |
69 | 69 | :markdown |
70 | 70 | ### [remote-doc](remote-doc-manifest.html) tests have _input_ and _expected_ documents. |
71 | 71 |
|
|
80 | 80 | * _redirectTo_: The HTTP _Content-Location_ header value. |
81 | 81 | * _httpLink_: The HTTP _Link_ header value. |
82 | 82 |
|
83 | | - - if manifest['sequence'].first.is_a?(String) || manifest['sequence'].any? {|te| te['@type'].include?('jld:FromRdfTest')} |
| 83 | + - if ( manifest['inclusion'] && manifest['inclusion'].first.is_a?(String) ) || ( manifest['sequence'] && manifest['sequence'].any? {|te| te['@type'].include?('jld:FromRdfTest')} ) |
84 | 84 | :markdown |
85 | 85 | ### [fromRdf](fromRdf-manifest.html) tests have _input_ and _expected_ documents. |
86 | 86 |
|
87 | 87 | The _expected_ results can be compared using [JSON-LD object comparison](#json-ld-object-comparison) with the processor output. |
88 | 88 |
|
89 | | - - if manifest['sequence'].first.is_a?(String) || manifest['sequence'].any? {|te| te['@type'].include?('jld:ToRdfTest')} |
| 89 | + - if ( manifest['inclusion'] && manifest['inclusion'].first.is_a?(String) ) || ( manifest['sequence'] && manifest['sequence'].any? {|te| te['@type'].include?('jld:ToRdfTest')} ) |
90 | 90 | :markdown |
91 | 91 | ### [toRdf](toRdf-manifest.html) tests have _input_ and _expected_ documents. |
92 | 92 |
|
|
159 | 159 | %dl |
160 | 160 | %dt="baseIri" |
161 | 161 | %dd=manifest['baseIri'] |
162 | | - - if manifest['sequence'] |
| 162 | + - if manifest['inclusion'] |
163 | 163 | %section |
164 | 164 | %h2 |
165 | 165 | Test sequence: |
166 | | - - if manifest['sequence'].first.is_a?(String) |
| 166 | + - if manifest['inclusion'].first.is_a?(String) |
167 | 167 | %ul |
168 | | - - manifest['sequence'].each do |man| |
| 168 | + - manifest['inclusion'].each do |man| |
169 | 169 | - man_name = man.sub('.jsonld', '') |
170 | 170 | %li |
171 | 171 | %a{href: "#{man_name}.html"}<=man_name |
172 | | - - else |
173 | | - %dl.entries |
174 | | - - manifest['sequence'].each do |entry| |
175 | | - %dt{id: entry['@id'][1..-1]} |
176 | | - ="Test #{entry['@id'][1..-1]} #{entry['name']}" |
| 172 | + - if manifest['sequence'] |
| 173 | + %dl.entries |
| 174 | + - manifest['sequence'].each do |entry| |
| 175 | + %dt{id: entry['@id'][1..-1]} |
| 176 | + ="Test #{entry['@id'][1..-1]} #{entry['name']}" |
| 177 | + %dd |
| 178 | + %dl.entry |
| 179 | + %dt="id" |
| 180 | + %dd=entry['@id'] |
| 181 | + %dt="Type" |
| 182 | + %dd="#{Array(entry['@type']).join(', ')}" |
| 183 | + %dt="Purpose" |
| 184 | + %dd=entry['purpose'] |
| 185 | + %dt="input" |
| 186 | + %dd |
| 187 | + %a{href: entry['input']}=entry['input'] |
| 188 | + - if entry['context'] |
| 189 | + %dt="context" |
| 190 | + %dd |
| 191 | + %a{href: entry['context']}=entry['context'] |
| 192 | + - if entry['frame'] |
| 193 | + %dt="frame" |
| 194 | + %dd |
| 195 | + %a{href: entry['frame']}=entry['frame'] |
| 196 | + %dt="expect" |
177 | 197 | %dd |
178 | | - %dl.entry |
179 | | - %dt="id" |
180 | | - %dd=entry['@id'] |
181 | | - %dt="Type" |
182 | | - %dd="#{Array(entry['@type']).join(', ')}" |
183 | | - %dt="Purpose" |
184 | | - %dd=entry['purpose'] |
185 | | - %dt="input" |
186 | | - %dd |
187 | | - %a{href: entry['input']}=entry['input'] |
188 | | - - if entry['context'] |
189 | | - %dt="context" |
190 | | - %dd |
191 | | - %a{href: entry['context']}=entry['context'] |
192 | | - - if entry['frame'] |
193 | | - %dt="frame" |
194 | | - %dd |
195 | | - %a{href: entry['frame']}=entry['frame'] |
196 | | - %dt="expect" |
197 | | - %dd |
198 | | - - if entry['@type'].to_s.include?('Negative') |
199 | | - =entry['expectErrorCode'] |
200 | | - - else |
201 | | - %a{href: entry['expect']}=entry['expect'] |
202 | | - - if entry['option'] |
203 | | - %dt="Options" |
204 | | - %dd |
205 | | - %dl.options |
206 | | - - entry['option'].each do |k, v| |
207 | | - %dt=k |
208 | | - %dd=v |
209 | | - - if entry['requires'] |
210 | | - %dt="Requires" |
211 | | - %dd= entry['requires'] |
| 198 | + - if entry['@type'].to_s.include?('Negative') |
| 199 | + =entry['expectErrorCode'] |
| 200 | + - else |
| 201 | + %a{href: entry['expect']}=entry['expect'] |
| 202 | + - if entry['option'] |
| 203 | + %dt="Options" |
| 204 | + %dd |
| 205 | + %dl.options |
| 206 | + - entry['option'].each do |k, v| |
| 207 | + %dt=k |
| 208 | + %dd=v |
| 209 | + - if entry['requires'] |
| 210 | + %dt="Requires" |
| 211 | + %dd= entry['requires'] |
0 commit comments