Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should match 3 with 4 for [RLI, RLI, RLI, FSI, PDI, PDI, PDI, PDI]', () => {
const codepoints = List.of(RLI, RLI, RLI, FSI, PDI, PDI, PDI, PDI);
expect(matchingPDIForIndex(codepoints, 3)).to.equal(4);
});
it('should change [AN,CS,AN] to [AN,AN,AN]', () => {
const points = List.of(AN, CS, AN);
const types = List.of('AN', 'CS', 'AN');
expect(es(types, points)).to.equal(List.of('AN', 'AN', 'AN'));
});
it('prepends matching values of lesser specificity to the result', () => {
registry.register('a', 1)
registry.register(['a', 'b'], 2)
registry.register(['a', 'b'], 20)
registry.register(['a', 'b', 'c'], 3)
registry.register('a', 4)
registry.register(['a', 'b'], 5)
expect(registry.get('a')).toEqualI(List.of(1, 4))
expect(registry.get(['a', 'b'])).toEqualI(List.of(1, 4, 2, 20, 5))
expect(registry.get(['a', 'b', 'c'])).toEqualI(List.of(1, 4, 2, 20, 5, 3))
})
})
test('contains', () => {
expect(R.contains(1, List.of(1, 2))).toBe(true);
expect(R.contains(1, List.of(3, 2))).toBe(false);
expect(R.contains(List.of(1), fromJS([1, [1]]))).toBe(true);
expect(R.contains([1], fromJS([1, [1]]))).toBe(false);
expect(R.contains([1], List.of([1, [1]]))).toBe(false);
});
test('all', () => {
const equals3 = R.equals(3);
expect(R.all(equals3, List.of(3, 3, 3, 3))).toBe(true);
expect(R.all(equals3, List.of(3, 2, 3, 2))).toBe(false);
expect(R.all(equals3, [3, 3, 3, 3])).toBe(true);
});
test('assoc', () => {
expect(R.assoc('name', 'bla', Map({a: 1}))).toEqualI(Map({name: 'bla', a: 1}));
expect(R.assoc(1, 'bla', List.of('a', 'b'))).toEqualI(List.of('a', 'bla'));
});
test('append', () => {
expect(R.append(3, List())).toEqualI(List.of(3));
expect(R.append(3, List.of(1, 2))).toEqualI(List.of(1, 2, 3));
expect(R.append(3)(List.of(1))).toEqualI(List.of(1, 3));
});
it('should give partial permutations; ignoring all levels marked as invisible ("x")', () => {
expect(reorderPermutation(List.of(0,'x',1,'x'), IGNORE_INVISIBLE)).to.equal(List.of(0,2));
expect(reorderPermutation(List.of('x',1,4), IGNORE_INVISIBLE)).to.equal(List.of(2,1));
expect(reorderPermutation(List.of(2,1,'x',1), IGNORE_INVISIBLE)).to.equal(List.of(3,1,0));
});
expect(() =>
ui.register(List.of('component', 'subkind'), Comp)
).not.toThrow()
function readFixedTimeFilter(selection: LiteralExpression, dimension: Dimension): FixedTimeFilterClause {
const { name: reference } = dimension;
return new FixedTimeFilterClause({ reference, values: List.of(new DateRange(selection.value as TimeRange)) });
}