Skip to content

Commit 802b998

Browse files
Adding tests
1 parent b65ea31 commit 802b998

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/woql.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,23 @@ describe('woql queries', () => {
364364

365365
expect(varsArr[0]).to.be.instanceof(Var);
366366
});
367+
368+
it('check type_of(Var,Var)', () => {
369+
const TypeOf = WOQL.type_of('v:X', 'v:Y').json()
370+
expect(TypeOf).to.deep.eql({
371+
'@type': 'TypeOf',
372+
value: { '@type': 'Value', variable: 'X' },
373+
type: { '@type': 'NodeValue', variable: 'Y' }
374+
})
375+
});
376+
377+
it('check type_of(OBJ,Var)', () => {
378+
const TypeOf = WOQL.type_of(WOQL.string("X"), 'v:Y').json()
379+
expect(TypeOf).to.deep.eql({
380+
'@type': 'TypeOf',
381+
value: { '@type': 'Value', data: { '@type': 'xsd:string', '@value': 'X' } },
382+
type: { '@type': 'NodeValue', variable: 'Y' }
383+
})
384+
});
385+
367386
});

0 commit comments

Comments
 (0)