MCPcopy
hub / github.com/apache/echarts / testFilterComparator

Function testFilterComparator

test/ut/spec/data/dataValueHelper.test.ts:354–374  ·  view source on GitHub ↗
(op: Operation)

Source from the content-addressed store, hash-verified

352 describe('filter_relational_comparison', function () {
353
354 function testFilterComparator(op: Operation) {
355 it(op + '_filter_comparator', () => {
356 eachRelationalComparisonCase((lval, rval, caseTag) => {
357 expect(filterResultMap.hasOwnProperty(caseTag));
358 expect(filterResultMap[caseTag].hasOwnProperty(op));
359 const expectedResult = filterResultMap[caseTag][op];
360
361 if ((op === 'lt' || op === 'lte' || op === 'gt' || op === 'gte')
362 && typeof rval !== 'number'
363 ) {
364 expect(() => {
365 dataValueHelper.createFilterComparator(op, rval);
366 }).toThrow();
367 }
368 else {
369 const comparator = dataValueHelper.createFilterComparator(op, rval);
370 expect(comparator.evaluate(lval)).toEqual(expectedResult);
371 }
372 });
373 });
374 }
375 testFilterComparator('lt');
376 testFilterComparator('lte');
377 testFilterComparator('gt');

Callers 1

Calls 2

evaluateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…