Skip to content

Commit cd9fd6f

Browse files
committed
Use explicit id/description test skipping regexes.
- Avoid just running a regex on the description and mistakenly skipping too many tests. This happened trying to skip an ExpandTest short id hash that was in both expand-manifest.jsonld and remote-doc-manifest.jsonld. - Switch to support idRegex and descriptionRegex. - Update all skip tests to id regexes that check for manifest name.
1 parent 329ace3 commit cd9fd6f

File tree

2 files changed

+129
-117
lines changed

2 files changed

+129
-117
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# jsonld ChangeLog
22

3+
### Fixed
4+
- Use explicit id or description test skipping regexes.
5+
36
## 1.5.4 - 2019-02-28
47

58
### Fixed

tests/test-common.js

Lines changed: 126 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,31 @@ const TEST_TYPES = {
3636
// see JSON-LD 1.0 Errata
3737
specVersion: ['json-ld-1.0'],
3838
// FIXME
39-
regex: [
39+
idRegex: [
4040
// list of lists
41-
/^#tli01/,
42-
/^#tli02/,
43-
/^#tli03/,
44-
/^#tli04/,
45-
/^#tli05/,
41+
/compact-manifest.jsonld#tli01$/,
42+
/compact-manifest.jsonld#tli02$/,
43+
/compact-manifest.jsonld#tli03$/,
44+
/compact-manifest.jsonld#tli04$/,
45+
/compact-manifest.jsonld#tli05$/,
4646
// terms
47-
/^#tp001/,
47+
/compact-manifest.jsonld#tp001$/,
4848
// rel iri
49-
/^#t0095/,
49+
/compact-manifest.jsonld#t0095$/,
5050
// type set
51-
/^#t0104/,
52-
/^#t0105/,
51+
/compact-manifest.jsonld#t0104$/,
52+
/compact-manifest.jsonld#t0105$/,
5353
// rel vocab
54-
/^#t0107/,
54+
/compact-manifest.jsonld#t0107$/,
5555
// html
56-
/^#th001/,
57-
/^#th002/,
58-
/^#th003/,
59-
/^#th004/,
56+
/compact-manifest.jsonld#th001$/,
57+
/compact-manifest.jsonld#th002$/,
58+
/compact-manifest.jsonld#th003$/,
59+
/compact-manifest.jsonld#th004$/,
6060
// @type: @none
61-
/^#ttn01/,
62-
/^#ttn02/,
63-
/^#ttn03/,
61+
/compact-manifest.jsonld#ttn01$/,
62+
/compact-manifest.jsonld#ttn02$/,
63+
/compact-manifest.jsonld#ttn03$/,
6464
]
6565
},
6666
fn: 'compact',
@@ -74,68 +74,68 @@ const TEST_TYPES = {
7474
'jld:ExpandTest': {
7575
skip: {
7676
// FIXME
77-
regex: [
77+
idRegex: [
7878
// list of lists
79-
/^#tli01/,
80-
/^#tli02/,
81-
/^#tli03/,
82-
/^#tli04/,
83-
/^#tli05/,
84-
/^#tli06/,
85-
/^#tli07/,
86-
/^#tli08/,
87-
/^#tli09/,
88-
/^#tli10/,
79+
/expand-manifest.jsonld#tli01$/,
80+
/expand-manifest.jsonld#tli02$/,
81+
/expand-manifest.jsonld#tli03$/,
82+
/expand-manifest.jsonld#tli04$/,
83+
/expand-manifest.jsonld#tli05$/,
84+
/expand-manifest.jsonld#tli06$/,
85+
/expand-manifest.jsonld#tli07$/,
86+
/expand-manifest.jsonld#tli08$/,
87+
/expand-manifest.jsonld#tli09$/,
88+
/expand-manifest.jsonld#tli10$/,
8989
// mode
90-
/^#tp001/,
91-
/^#tp002/,
90+
/expand-manifest.jsonld#tp001$/,
91+
/expand-manifest.jsonld#tp002$/,
9292
// rel iri
93-
/^#t0092/,
94-
// remote
95-
/^#t0005/,
96-
/^#t0006/,
97-
/^#t0007/,
98-
/^#t0010/,
99-
/^#t0011/,
100-
/^#t0012/,
93+
/expand-manifest.jsonld#t0092$/,
10194
// iris
102-
/^#t0109/,
95+
/expand-manifest.jsonld#t0109$/,
10396
// rel vocab
104-
/^#t0110/,
105-
/^#t0111/,
106-
/^#t0112/,
97+
/expand-manifest.jsonld#t0110$/,
98+
/expand-manifest.jsonld#t0111$/,
99+
/expand-manifest.jsonld#t0112$/,
107100
// html
108-
/^#th001/,
109-
/^#th002/,
110-
/^#th003/,
111-
/^#th004/,
112-
/^#th005/,
113-
/^#th006/,
114-
/^#th007/,
115-
/^#th010/,
116-
/^#th011/,
117-
/^#th012/,
118-
/^#th013/,
119-
/^#th014/,
120-
/^#th015/,
121-
/^#th016/,
122-
/^#th017/,
123-
/^#th018/,
124-
/^#th019/,
125-
/^#th020/,
126-
/^#th021/,
127-
/^#th022/,
101+
/expand-manifest.jsonld#th001$/,
102+
/expand-manifest.jsonld#th002$/,
103+
/expand-manifest.jsonld#th003$/,
104+
/expand-manifest.jsonld#th004$/,
105+
/expand-manifest.jsonld#th005$/,
106+
/expand-manifest.jsonld#th006$/,
107+
/expand-manifest.jsonld#th007$/,
108+
/expand-manifest.jsonld#th010$/,
109+
/expand-manifest.jsonld#th011$/,
110+
/expand-manifest.jsonld#th012$/,
111+
/expand-manifest.jsonld#th013$/,
112+
/expand-manifest.jsonld#th014$/,
113+
/expand-manifest.jsonld#th015$/,
114+
/expand-manifest.jsonld#th016$/,
115+
/expand-manifest.jsonld#th017$/,
116+
/expand-manifest.jsonld#th018$/,
117+
/expand-manifest.jsonld#th019$/,
118+
/expand-manifest.jsonld#th020$/,
119+
/expand-manifest.jsonld#th021$/,
120+
/expand-manifest.jsonld#th022$/,
128121
// sealed
129-
/^#tse01/,
130-
/^#tse02/,
131-
/^#tse03/,
132-
/^#tse04/,
133-
/^#tse05/,
134-
/^#tse06/,
135-
/^#tse08/,
136-
/^#tse09/,
122+
/expand-manifest.jsonld#tse01$/,
123+
/expand-manifest.jsonld#tse02$/,
124+
/expand-manifest.jsonld#tse03$/,
125+
/expand-manifest.jsonld#tse04$/,
126+
/expand-manifest.jsonld#tse05$/,
127+
/expand-manifest.jsonld#tse06$/,
128+
/expand-manifest.jsonld#tse08$/,
129+
/expand-manifest.jsonld#tse09$/,
137130
// @type: @none
138-
/^#ttn02/,
131+
/expand-manifest.jsonld#ttn02$/,
132+
// remote
133+
/remote-doc-manifest.jsonld#t0005$/,
134+
/remote-doc-manifest.jsonld#t0006$/,
135+
/remote-doc-manifest.jsonld#t0007$/,
136+
/remote-doc-manifest.jsonld#t0010$/,
137+
/remote-doc-manifest.jsonld#t0011$/,
138+
/remote-doc-manifest.jsonld#t0012$/,
139139
]
140140
},
141141
fn: 'expand',
@@ -148,16 +148,16 @@ const TEST_TYPES = {
148148
'jld:FlattenTest': {
149149
skip: {
150150
// FIXME
151-
regex: [
151+
idRegex: [
152152
// list of lists
153-
/^#tli01/,
154-
/^#tli02/,
155-
/^#tli03/,
153+
/flatten-manifest.jsonld#tli01$/,
154+
/flatten-manifest.jsonld#tli02$/,
155+
/flatten-manifest.jsonld#tli03$/,
156156
// html
157-
/^#th001/,
158-
/^#th002/,
159-
/^#th003/,
160-
/^#th004/,
157+
/flatten-manifest.jsonld#th001$/,
158+
/flatten-manifest.jsonld#th002$/,
159+
/flatten-manifest.jsonld#th003$/,
160+
/flatten-manifest.jsonld#th004$/,
161161
]
162162
},
163163
fn: 'flatten',
@@ -171,29 +171,29 @@ const TEST_TYPES = {
171171
'jld:FrameTest': {
172172
skip: {
173173
// FIXME
174-
regex: [
174+
idRegex: [
175175
// ex
176-
/^#tg001/,
176+
/frame-manifest.jsonld#tg001$/,
177177
// graphs
178-
/^#t0010/,
179-
/^#t0020/,
180-
/^#t0046/,
181-
/^#t0049/,
182-
/^#t0051/,
183-
/^#tg010/,
184-
/^#tp046/,
185-
/^#tp049/,
178+
/frame-manifest.jsonld#t0010$/,
179+
/frame-manifest.jsonld#t0020$/,
180+
/frame-manifest.jsonld#t0046$/,
181+
/frame-manifest.jsonld#t0049$/,
182+
/frame-manifest.jsonld#t0051$/,
183+
/frame-manifest.jsonld#tg010$/,
184+
/frame-manifest.jsonld#tp046$/,
185+
/frame-manifest.jsonld#tp049$/,
186186
// blank nodes
187-
/^#t0052/,
188-
/^#t0053/,
187+
/frame-manifest.jsonld#t0052$/,
188+
/frame-manifest.jsonld#t0053$/,
189189
// embed
190-
/^#t0054/,
190+
/frame-manifest.jsonld#t0054$/,
191191
// lists
192-
/^#t0055/,
193-
/^#t0058/,
192+
/frame-manifest.jsonld#t0055$/,
193+
/frame-manifest.jsonld#t0058$/,
194194
// misc
195-
/^#tp010/,
196-
/^#tp050/,
195+
/frame-manifest.jsonld#tp010$/,
196+
/frame-manifest.jsonld#tp050$/,
197197
]
198198
},
199199
fn: 'frame',
@@ -207,11 +207,11 @@ const TEST_TYPES = {
207207
'jld:FromRDFTest': {
208208
skip: {
209209
// FIXME
210-
regex: [
210+
idRegex: [
211211
// list of lists
212-
/^#tli01/,
213-
/^#tli02/,
214-
/^#tli03/,
212+
/fromRdf-manifest.jsonld#tli01$/,
213+
/fromRdf-manifest.jsonld#tli02$/,
214+
/fromRdf-manifest.jsonld#tli03$/,
215215
]
216216
},
217217
fn: 'fromRDF',
@@ -232,24 +232,24 @@ const TEST_TYPES = {
232232
'jld:ToRDFTest': {
233233
skip: {
234234
// FIXME
235-
regex: [
235+
idRegex: [
236236
// list of lists
237-
/^#tli01/,
238-
/^#tli02/,
237+
/toRdf-manifest.jsonld#tli01$/,
238+
/toRdf-manifest.jsonld#tli02$/,
239239
// blank node properties
240-
/^#t0118/,
240+
/toRdf-manifest.jsonld#t0118$/,
241241
// well formed
242-
/^#twf01/,
243-
/^#twf02/,
244-
/^#twf03/,
245-
/^#twf04/,
246-
/^#twf05/,
247-
/^#twf06/,
248-
/^#twf07/,
242+
/toRdf-manifest.jsonld#twf01$/,
243+
/toRdf-manifest.jsonld#twf02$/,
244+
/toRdf-manifest.jsonld#twf03$/,
245+
/toRdf-manifest.jsonld#twf04$/,
246+
/toRdf-manifest.jsonld#twf05$/,
247+
/toRdf-manifest.jsonld#twf06$/,
248+
/toRdf-manifest.jsonld#twf07$/,
249249
// html
250-
/^#th001/,
251-
/^#th002/,
252-
/^#th003/,
250+
/toRdf-manifest.jsonld#th001$/,
251+
/toRdf-manifest.jsonld#th002$/,
252+
/toRdf-manifest.jsonld#th003$/,
253253
]
254254
},
255255
fn: 'toRDF',
@@ -460,8 +460,17 @@ function addTest(manifest, test, tests) {
460460
self.skip();
461461
}
462462

463-
if(testInfo.skip && testInfo.skip.regex) {
464-
testInfo.skip.regex.forEach(function(re) {
463+
if(testInfo.skip && testInfo.skip.idRegex) {
464+
testInfo.skip.idRegex.forEach(function(re) {
465+
if(re.test(test['@id'])) {
466+
//console.log('Skipping test "' + test.name + '" of description: ' + description);
467+
self.skip();
468+
}
469+
});
470+
}
471+
472+
if(testInfo.skip && testInfo.skip.descriptionRegex) {
473+
testInfo.skip.descriptionRegex.forEach(function(re) {
465474
if(re.test(description)) {
466475
//console.log('Skipping test "' + test.name + '" of description: ' + description);
467476
self.skip();

0 commit comments

Comments
 (0)