Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('Returns an empty sequence when one of the inputs is an empty sequence', () => {
chai.assert.deepEqual(evaluateXPathToStrings('compare("a", ())', documentNode), []);
chai.assert.deepEqual(evaluateXPathToStrings('compare((), "a")', documentNode), []);
});
it('returns the original sequence when the position is out of bounds (greater than largest position)', () =>
chai.assert.deepEqual(
evaluateXPathToStrings('remove(("a", "b", "c"), 5)', documentNode),
['a', 'b', 'c']
));
it('returns the sequence with the item at the given position removed', () =>
it('returns the empty sequence when inputted a start higher than the length of the input', () =>
chai.assert.deepEqual(
evaluateXPathToStrings('subsequence(("a", "b", "c"), 4)', documentNode),
[]
));
it('returns the last item if the start is length', () =>
it('returns a sequence starting at position until the end of the given sequence', () =>
chai.assert.deepEqual(
evaluateXPathToStrings('subsequence(("a", "b", "c"), 2)', documentNode),
['b', 'c']
));
it('returns the empty sequence when inputted a start higher than the length of the input', () =>
it('returns an reversed sequence', () =>
chai.assert.deepEqual(
evaluateXPathToStrings('reverse(("a", "b", "c"))', documentNode),
['c', 'b', 'a']
));
});
it('returns the first item when start = -10 and length = 12 FIRST', () =>
chai.assert.deepEqual(
evaluateXPathToStrings('subsequence(("a", "b", "c"), -10, 12)', documentNode),
['a']
));
it('returns the first item when start = -10 and length = 12 SECOND, for static compilation checks', () =>
it('returns the full sequence when start = 1 and length = INF', () =>
chai.assert.deepEqual(
evaluateXPathToStrings(
'subsequence(("a", "b", "c"), 0, xs:double("+INF"))',
documentNode
),
['a', 'b', 'c']
));
it('returns the first item when start = -10 and length = 12 FIRST', () =>
() => chai.assert.deepEqual(evaluateXPathToStrings('max(())', documentNode), []));
it('casts untypedAtomic to double');
it('accepts a sequence as first expression: (1, 2, 3) ! string()', () =>
chai.assert.deepEqual(evaluateXPathToStrings('(1, 2, 3) ! string()', documentNode), [
'1',
'2',
'3'
]));
() => chai.assert.deepEqual(evaluateXPathToStrings('(1, 2, 3) ! string()', documentNode), ['1', '2', '3']));