@@ -328,18 +328,34 @@ function legacyFilterTests(createFilterExpr) {
328328 expect ( f ( { zoom : 0 } , { properties : { } } ) ) . toBe ( false ) ;
329329 } ) ;
330330
331+ const UnknownGeometry = { type : 0 } ;
332+ const PointGeometry = { type : 1 , geometry : [
333+ [ { x : 0 , y : 0 } ] ] } ;
334+ const MultiPointGeometry = { type : 1 , geometry : [
335+ [ { x : 0 , y : 0 } ] ,
336+ [ { x : 1 , y : 1 } ] ] } ;
337+ const LinestringGeometry = { type : 2 , geometry : [
338+ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ;
339+ const MultiLineStringGeometry = { type : 2 , geometry : [
340+ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ,
341+ [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ;
342+ const PolygonGeometry = { type : 3 , geometry : [
343+ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
344+ [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ;
345+ const MultiPolygonGeometry = { type : 3 , geometry : [
346+ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
347+ [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
348+ [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ;
349+
331350 test ( '==, $type, Point' , ( ) => {
332351 const fPoint = createFilterExpr ( [ '==' , '$type' , 'Point' ] ) . filter ;
333- expect ( fPoint ( { zoom : 0 } , { type : 0 } ) ) . toBe ( false ) ; // Unknown geometry-type
334- expect ( fPoint ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // Point geometry-type
335- expect ( fPoint ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] , [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiPoint geometry-type
336- expect ( fPoint ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ) ) . toBe ( false ) ; // Linestring geometry-type
337- expect ( fPoint ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] , [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiLineString geometry-type
338- expect ( fPoint ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
339- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // Polygon geometry-type
340- expect ( fPoint ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
341- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
342- [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiPolygon geometry-type
352+ expect ( fPoint ( { zoom : 0 } , UnknownGeometry ) ) . toBe ( false ) ;
353+ expect ( fPoint ( { zoom : 0 } , PointGeometry ) ) . toBe ( true ) ;
354+ expect ( fPoint ( { zoom : 0 } , MultiPointGeometry ) ) . toBe ( true ) ;
355+ expect ( fPoint ( { zoom : 0 } , LinestringGeometry ) ) . toBe ( false ) ;
356+ expect ( fPoint ( { zoom : 0 } , MultiLineStringGeometry ) ) . toBe ( false ) ;
357+ expect ( fPoint ( { zoom : 0 } , PolygonGeometry ) ) . toBe ( false ) ;
358+ expect ( fPoint ( { zoom : 0 } , MultiPolygonGeometry ) ) . toBe ( false ) ;
343359 expect ( fPoint ( { zoom : 0 } , { type : 'Unknown' } ) ) . toBe ( false ) ;
344360 expect ( fPoint ( { zoom : 0 } , { type : 'Point' } ) ) . toBe ( true ) ;
345361 expect ( fPoint ( { zoom : 0 } , { type : 'MultiPoint' } ) ) . toBe ( true ) ;
@@ -351,16 +367,13 @@ function legacyFilterTests(createFilterExpr) {
351367
352368 test ( '==, $type, LineString' , ( ) => {
353369 const fLineString = createFilterExpr ( [ '==' , '$type' , 'LineString' ] ) . filter ;
354- expect ( fLineString ( { zoom : 0 } , { type : 0 } ) ) . toBe ( false ) ; // Unknown geometry-type
355- expect ( fLineString ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // Point geometry-type
356- expect ( fLineString ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] , [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiPoint geometry-type
357- expect ( fLineString ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ) ) . toBe ( true ) ; // Linestring geometry-type
358- expect ( fLineString ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] , [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiLineString geometry-type
359- expect ( fLineString ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
360- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // Polygon geometry-type
361- expect ( fLineString ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
362- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
363- [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiPolygon geometry-type
370+ expect ( fLineString ( { zoom : 0 } , UnknownGeometry ) ) . toBe ( false ) ;
371+ expect ( fLineString ( { zoom : 0 } , PointGeometry ) ) . toBe ( false ) ;
372+ expect ( fLineString ( { zoom : 0 } , MultiPointGeometry ) ) . toBe ( false ) ;
373+ expect ( fLineString ( { zoom : 0 } , LinestringGeometry ) ) . toBe ( true ) ;
374+ expect ( fLineString ( { zoom : 0 } , MultiLineStringGeometry ) ) . toBe ( true ) ;
375+ expect ( fLineString ( { zoom : 0 } , PolygonGeometry ) ) . toBe ( false ) ;
376+ expect ( fLineString ( { zoom : 0 } , MultiPolygonGeometry ) ) . toBe ( false ) ;
364377 expect ( fLineString ( { zoom : 0 } , { type : 'Unknown' } ) ) . toBe ( false ) ;
365378 expect ( fLineString ( { zoom : 0 } , { type : 'Point' } ) ) . toBe ( false ) ;
366379 expect ( fLineString ( { zoom : 0 } , { type : 'MultiPoint' } ) ) . toBe ( false ) ;
@@ -371,17 +384,15 @@ function legacyFilterTests(createFilterExpr) {
371384 } ) ;
372385
373386 test ( '==, $type, Polygon' , ( ) => {
387+
374388 const fPolygon = createFilterExpr ( [ '==' , '$type' , 'Polygon' ] ) . filter ;
375- expect ( fPolygon ( { zoom : 0 } , { type : 0 } ) ) . toBe ( false ) ; // Unknown geometry-type
376- expect ( fPolygon ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // Point geometry-type
377- expect ( fPolygon ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] , [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiPoint geometry-type
378- expect ( fPolygon ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ) ) . toBe ( false ) ; // Linestring geometry-type
379- expect ( fPolygon ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] , [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiLineString geometry-type
380- expect ( fPolygon ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
381- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // Polygon geometry-type
382- expect ( fPolygon ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
383- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
384- [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiPolygon geometry-type
389+ expect ( fPolygon ( { zoom : 0 } , UnknownGeometry ) ) . toBe ( false ) ;
390+ expect ( fPolygon ( { zoom : 0 } , PointGeometry ) ) . toBe ( false ) ;
391+ expect ( fPolygon ( { zoom : 0 } , MultiPointGeometry ) ) . toBe ( false ) ;
392+ expect ( fPolygon ( { zoom : 0 } , LinestringGeometry ) ) . toBe ( false ) ;
393+ expect ( fPolygon ( { zoom : 0 } , MultiLineStringGeometry ) ) . toBe ( false ) ;
394+ expect ( fPolygon ( { zoom : 0 } , PolygonGeometry ) ) . toBe ( true ) ;
395+ expect ( fPolygon ( { zoom : 0 } , MultiPolygonGeometry ) ) . toBe ( true ) ;
385396 expect ( fPolygon ( { zoom : 0 } , { type : 'Unknown' } ) ) . toBe ( false ) ;
386397 expect ( fPolygon ( { zoom : 0 } , { type : 'Point' } ) ) . toBe ( false ) ;
387398 expect ( fPolygon ( { zoom : 0 } , { type : 'MultiPoint' } ) ) . toBe ( false ) ;
@@ -393,16 +404,13 @@ function legacyFilterTests(createFilterExpr) {
393404
394405 test ( '==, $type, Unknown' , ( ) => {
395406 const fUnknown = createFilterExpr ( [ '==' , '$type' , 'Unknown' ] ) . filter ;
396- expect ( fUnknown ( { zoom : 0 } , { type : 0 } ) ) . toBe ( true ) ; // Unknown geometry-type
397- expect ( fUnknown ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // Point geometry-type
398- expect ( fUnknown ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] , [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiPoint geometry-type
399- expect ( fUnknown ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ) ) . toBe ( false ) ; // Linestring geometry-type
400- expect ( fUnknown ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] , [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiLineString geometry-type
401- expect ( fUnknown ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
402- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // Polygon geometry-type
403- expect ( fUnknown ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
404- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
405- [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiPolygon geometry-type
407+ expect ( fUnknown ( { zoom : 0 } , UnknownGeometry ) ) . toBe ( true ) ;
408+ expect ( fUnknown ( { zoom : 0 } , PointGeometry ) ) . toBe ( false ) ;
409+ expect ( fUnknown ( { zoom : 0 } , MultiPointGeometry ) ) . toBe ( false ) ;
410+ expect ( fUnknown ( { zoom : 0 } , LinestringGeometry ) ) . toBe ( false ) ;
411+ expect ( fUnknown ( { zoom : 0 } , MultiLineStringGeometry ) ) . toBe ( false ) ;
412+ expect ( fUnknown ( { zoom : 0 } , PolygonGeometry ) ) . toBe ( false ) ;
413+ expect ( fUnknown ( { zoom : 0 } , MultiPolygonGeometry ) ) . toBe ( false ) ;
406414 expect ( fUnknown ( { zoom : 0 } , { type : 'Unknown' } ) ) . toBe ( true ) ;
407415 expect ( fUnknown ( { zoom : 0 } , { type : 'Point' } ) ) . toBe ( false ) ;
408416 expect ( fUnknown ( { zoom : 0 } , { type : 'MultiPoint' } ) ) . toBe ( false ) ;
@@ -453,16 +461,13 @@ function legacyFilterTests(createFilterExpr) {
453461
454462 test ( '!=, $type, Point' , ( ) => {
455463 const fPoint = createFilterExpr ( [ '!=' , '$type' , 'Point' ] ) . filter ;
456- expect ( fPoint ( { zoom : 0 } , { type : 0 } ) ) . toBe ( true ) ; // Unknown geometry-type
457- expect ( fPoint ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // Point geometry-type
458- expect ( fPoint ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] , [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiPoint geometry-type
459- expect ( fPoint ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ) ) . toBe ( true ) ; // Linestring geometry-type
460- expect ( fPoint ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] , [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiLineString geometry-type
461- expect ( fPoint ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
462- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // Polygon geometry-type
463- expect ( fPoint ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
464- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
465- [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiPolygon geometry-type
464+ expect ( fPoint ( { zoom : 0 } , UnknownGeometry ) ) . toBe ( true ) ;
465+ expect ( fPoint ( { zoom : 0 } , PointGeometry ) ) . toBe ( false ) ;
466+ expect ( fPoint ( { zoom : 0 } , MultiPointGeometry ) ) . toBe ( false ) ;
467+ expect ( fPoint ( { zoom : 0 } , LinestringGeometry ) ) . toBe ( true ) ;
468+ expect ( fPoint ( { zoom : 0 } , MultiLineStringGeometry ) ) . toBe ( true ) ;
469+ expect ( fPoint ( { zoom : 0 } , PolygonGeometry ) ) . toBe ( true ) ;
470+ expect ( fPoint ( { zoom : 0 } , MultiPolygonGeometry ) ) . toBe ( true ) ;
466471 expect ( fPoint ( { zoom : 0 } , { type : 'Unknown' } ) ) . toBe ( true ) ;
467472 expect ( fPoint ( { zoom : 0 } , { type : 'Point' } ) ) . toBe ( false ) ;
468473 expect ( fPoint ( { zoom : 0 } , { type : 'MultiPoint' } ) ) . toBe ( false ) ;
@@ -474,16 +479,13 @@ function legacyFilterTests(createFilterExpr) {
474479
475480 test ( '!=, $type, LineString' , ( ) => {
476481 const fLineString = createFilterExpr ( [ '!=' , '$type' , 'LineString' ] ) . filter ;
477- expect ( fLineString ( { zoom : 0 } , { type : 0 } ) ) . toBe ( true ) ; // Unknown geometry-type
478- expect ( fLineString ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // Point geometry-type
479- expect ( fLineString ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] , [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiPoint geometry-type
480- expect ( fLineString ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ) ) . toBe ( false ) ; // Linestring geometry-type
481- expect ( fLineString ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] , [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiLineString geometry-type
482- expect ( fLineString ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
483- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // Polygon geometry-type
484- expect ( fLineString ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
485- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
486- [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiPolygon geometry-type
482+ expect ( fLineString ( { zoom : 0 } , UnknownGeometry ) ) . toBe ( true ) ;
483+ expect ( fLineString ( { zoom : 0 } , PointGeometry ) ) . toBe ( true ) ;
484+ expect ( fLineString ( { zoom : 0 } , MultiPointGeometry ) ) . toBe ( true ) ;
485+ expect ( fLineString ( { zoom : 0 } , LinestringGeometry ) ) . toBe ( false ) ;
486+ expect ( fLineString ( { zoom : 0 } , MultiLineStringGeometry ) ) . toBe ( false ) ;
487+ expect ( fLineString ( { zoom : 0 } , PolygonGeometry ) ) . toBe ( true ) ;
488+ expect ( fLineString ( { zoom : 0 } , MultiPolygonGeometry ) ) . toBe ( true ) ;
487489 expect ( fLineString ( { zoom : 0 } , { type : 'Unknown' } ) ) . toBe ( true ) ;
488490 expect ( fLineString ( { zoom : 0 } , { type : 'Point' } ) ) . toBe ( true ) ;
489491 expect ( fLineString ( { zoom : 0 } , { type : 'MultiPoint' } ) ) . toBe ( true ) ;
@@ -495,16 +497,13 @@ function legacyFilterTests(createFilterExpr) {
495497
496498 test ( '!=, $type, Polygon' , ( ) => {
497499 const fPolygon = createFilterExpr ( [ '!=' , '$type' , 'Polygon' ] ) . filter ;
498- expect ( fPolygon ( { zoom : 0 } , { type : 0 } ) ) . toBe ( true ) ; // Unknown geometry-type
499- expect ( fPolygon ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // Point geometry-type
500- expect ( fPolygon ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] , [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiPoint geometry-type
501- expect ( fPolygon ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ) ) . toBe ( true ) ; // Linestring geometry-type
502- expect ( fPolygon ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] , [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiLineString geometry-type
503- expect ( fPolygon ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
504- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // Polygon geometry-type
505- expect ( fPolygon ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
506- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
507- [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( false ) ; // MultiPolygon geometry-type
500+ expect ( fPolygon ( { zoom : 0 } , UnknownGeometry ) ) . toBe ( true ) ;
501+ expect ( fPolygon ( { zoom : 0 } , PointGeometry ) ) . toBe ( true ) ;
502+ expect ( fPolygon ( { zoom : 0 } , MultiPointGeometry ) ) . toBe ( true ) ;
503+ expect ( fPolygon ( { zoom : 0 } , LinestringGeometry ) ) . toBe ( true ) ;
504+ expect ( fPolygon ( { zoom : 0 } , MultiLineStringGeometry ) ) . toBe ( true ) ;
505+ expect ( fPolygon ( { zoom : 0 } , PolygonGeometry ) ) . toBe ( false ) ;
506+ expect ( fPolygon ( { zoom : 0 } , MultiPolygonGeometry ) ) . toBe ( false ) ;
508507 expect ( fPolygon ( { zoom : 0 } , { type : 'Unknown' } ) ) . toBe ( true ) ;
509508 expect ( fPolygon ( { zoom : 0 } , { type : 'Point' } ) ) . toBe ( true ) ;
510509 expect ( fPolygon ( { zoom : 0 } , { type : 'MultiPoint' } ) ) . toBe ( true ) ;
@@ -516,16 +515,13 @@ function legacyFilterTests(createFilterExpr) {
516515
517516 test ( '!=, $type, Unknown' , ( ) => {
518517 const fUnknown = createFilterExpr ( [ '!=' , '$type' , 'Unknown' ] ) . filter ;
519- expect ( fUnknown ( { zoom : 0 } , { type : 0 } ) ) . toBe ( false ) ; // Unknown geometry-type
520- expect ( fUnknown ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // Point geometry-type
521- expect ( fUnknown ( { zoom : 0 } , { type : 1 , geometry : [ [ { x : 0 , y : 0 } ] , [ { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiPoint geometry-type
522- expect ( fUnknown ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] ] } ) ) . toBe ( true ) ; // Linestring geometry-type
523- expect ( fUnknown ( { zoom : 0 } , { type : 2 , geometry : [ [ { x : 0 , y : 0 } , { x : 1 , y : 1 } ] , [ { x : 2 , y : 0 } , { x : 1 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiLineString geometry-type
524- expect ( fUnknown ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
525- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // Polygon geometry-type
526- expect ( fUnknown ( { zoom : 0 } , { type : 3 , geometry : [ [ { x : 0 , y : 0 } , { x : 3 , y : 0 } , { x : 3 , y : 3 } , { x : 0 , y : 3 } , { x : 0 , y : 0 } ] ,
527- [ { x : 0 , y : 0 } , { x : 0 , y : 2 } , { x : 2 , y : 2 } , { x : 2 , y : 0 } , { x : 0 , y : 0 } ] ,
528- [ { x : 0 , y : 0 } , { x : 1 , y : 0 } , { x : 1 , y : 1 } , { x : 0 , y : 1 } , { x : 0 , y : 0 } ] ] } ) ) . toBe ( true ) ; // MultiPolygon geometry-type
518+ expect ( fUnknown ( { zoom : 0 } , UnknownGeometry ) ) . toBe ( false ) ;
519+ expect ( fUnknown ( { zoom : 0 } , PointGeometry ) ) . toBe ( true ) ;
520+ expect ( fUnknown ( { zoom : 0 } , MultiPointGeometry ) ) . toBe ( true ) ;
521+ expect ( fUnknown ( { zoom : 0 } , LinestringGeometry ) ) . toBe ( true ) ;
522+ expect ( fUnknown ( { zoom : 0 } , MultiLineStringGeometry ) ) . toBe ( true ) ;
523+ expect ( fUnknown ( { zoom : 0 } , PolygonGeometry ) ) . toBe ( true ) ;
524+ expect ( fUnknown ( { zoom : 0 } , MultiPolygonGeometry ) ) . toBe ( true ) ;
529525 expect ( fUnknown ( { zoom : 0 } , { type : 'Unknown' } ) ) . toBe ( false ) ;
530526 expect ( fUnknown ( { zoom : 0 } , { type : 'Point' } ) ) . toBe ( true ) ;
531527 expect ( fUnknown ( { zoom : 0 } , { type : 'MultiPoint' } ) ) . toBe ( true ) ;
0 commit comments