Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zmiao committed Mar 20, 2020
1 parent 11541e3 commit f4c3a1d
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"expression": ["within", {
"type": "Polygon",
"coordinates": [[[-185.0, 60.0], [175.0, 60.0], [175.0, 65.0], [-185.0, 65.0], [-185.0, 60.0]]]
}],
"inputs": [[{
"zoom": 0,
"canonicalID": {
"z": 0,
"x": 0,
"y": 0
}
}, {
"geometry": {
"type": "LineString",
"coordinates": [[-183, 61], [-179, 62]]
}
}], [{
"zoom": 0,
"canonicalID": {
"z": 0,
"x": 0,
"y": 0
}
}, {
"geometry": {
"type": "LineString",
"coordinates": [[-183, 61], [181, 63]]
}
}], [{
"zoom": 0,
"canonicalID": {
"z": 0,
"x": 0,
"y": 0
}
}, {
"geometry": {
"type": "LineString",
"coordinates": [[-183, 62], [55, 63.5]]
}
}]],
"expected": {
"compiled": {
"type": "boolean",
"isFeatureConstant": false,
"isZoomConstant": true,
"result": "success"
},
"outputs": [true, false, true],
"serialized": ["within", {
"coordinates": [[[-185.0, 60.0], [175.0, 60.0], [175.0, 65.0], [-185.0, 65.0], [-185.0, 60.0]]],
"type": "Polygon"
}]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"expression": ["within", {
"type": "Polygon",
"coordinates": [[[-360.0, 60.0], [0.0, 60.0], [0.0, 65.0], [-360.0, 65.0], [-360.0, 60.0]]]
}],
"inputs": [[{
"zoom": 0,
"canonicalID": {
"z": 0,
"x": 0,
"y": 0
}
}, {
"geometry": {
"type": "Point",
"coordinates": [-183, 61]
}
}], [{
"zoom": 0,
"canonicalID": {
"z": 0,
"x": 0,
"y": 0
}
}, {
"geometry": {
"type": "Point",
"coordinates": [-361, 61]
}
}], [{
"zoom": 0,
"canonicalID": {
"z": 0,
"x": 0,
"y": 0
}
}, {
"geometry": {
"type": "Point",
"coordinates": [183, 62]
}
}], [{
"zoom": 0,
"canonicalID": {
"z": 0,
"x": 0,
"y": 0
}
}, {
"geometry": {
"type": "Point",
"coordinates": [55, 62]
}
}]],
"expected": {
"compiled": {
"type": "boolean",
"isFeatureConstant": false,
"isZoomConstant": true,
"result": "success"
},
"outputs": [true, true, true, true],
"serialized": ["within", {
"coordinates": [[[-360.0, 60.0], [0.0, 60.0], [0.0, 65.0], [-360.0, 65.0], [-360.0, 60.0]]],
"type": "Polygon"
}]
}
}

0 comments on commit f4c3a1d

Please sign in to comment.