Skip to content

Commit 5c29aff

Browse files
committed
adapting template to the new structure
1 parent ccf3d1e commit 5c29aff

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

tests/template.haml

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030

3131
## General instructions for running the JSON-LD Test suites
3232

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')} )
3434
:markdown
3535
### [compact](compact-manifest.html) tests have _input_, _expected_ and _context_ documents.
3636

3737
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).
3838

3939
For **NegativeEvaluationTests**, the result is a string associated with the expected error code.
4040

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')} )
4242
:markdown
4343
### [expand](expand-manifest.html) tests have _input_ and _expected_ documents.
4444

@@ -49,23 +49,23 @@
4949

5050
For **NegativeEvaluationTests**, the result is a string associated with the expected error code.
5151

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')} )
5353
:markdown
5454
### [html](html-manifest.html) tests have _input_ and _expected_ documents and an optional _context_ document.
5555

5656
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).
5757

5858
For **NegativeEvaluationTests**, the result is a string associated with the expected error code.
5959

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')} )
6161
:markdown
6262
### [flatten](flatten-manifest.html) tests have _input_ and _expected_ documents and an optional _context_ document.
6363

6464
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).
6565

6666
For **NegativeEvaluationTests**, the result is a string associated with the expected error code.
6767

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') )
6969
:markdown
7070
### [remote-doc](remote-doc-manifest.html) tests have _input_ and _expected_ documents.
7171

@@ -80,13 +80,13 @@
8080
* _redirectTo_: The HTTP _Content-Location_ header value.
8181
* _httpLink_: The HTTP _Link_ header value.
8282

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')} )
8484
:markdown
8585
### [fromRdf](fromRdf-manifest.html) tests have _input_ and _expected_ documents.
8686

8787
The _expected_ results can be compared using [JSON-LD object comparison](#json-ld-object-comparison) with the processor output.
8888

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')} )
9090
:markdown
9191
### [toRdf](toRdf-manifest.html) tests have _input_ and _expected_ documents.
9292

@@ -159,53 +159,53 @@
159159
%dl
160160
%dt="baseIri"
161161
%dd=manifest['baseIri']
162-
- if manifest['sequence']
162+
- if manifest['inclusion']
163163
%section
164164
%h2
165165
Test sequence:
166-
- if manifest['sequence'].first.is_a?(String)
166+
- if manifest['inclusion'].first.is_a?(String)
167167
%ul
168-
- manifest['sequence'].each do |man|
168+
- manifest['inclusion'].each do |man|
169169
- man_name = man.sub('.jsonld', '')
170170
%li
171171
%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"
177197
%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

Comments
 (0)