Skip to content

Commit 28930b3

Browse files
committed
Add ["geomerty-type"] tests
1 parent 2ed3000 commit 28930b3

File tree

6 files changed

+156
-11
lines changed

6 files changed

+156
-11
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"expression": [
3+
"geometry-type"
4+
],
5+
"inputs": [
6+
[
7+
{},
8+
{
9+
"geometry": {
10+
"type": "MultiLineString",
11+
"coordinates": [
12+
[[0, 0], [10, 10]],
13+
[[10, 0], [0, 10]]
14+
]
15+
}
16+
}
17+
]
18+
],
19+
"expected": {
20+
"compiled": {
21+
"result": "success",
22+
"isFeatureConstant": false,
23+
"isZoomConstant": true,
24+
"type": "string"
25+
},
26+
"outputs": [
27+
"MultiLineString"
28+
]
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"expression": [
3+
"geometry-type"
4+
],
5+
"inputs": [
6+
[
7+
{},
8+
{
9+
"geometry": {
10+
"type": "MultiPoint",
11+
"coordinates": [
12+
[10, 0],
13+
[0,10]
14+
]
15+
}
16+
}
17+
]
18+
],
19+
"expected": {
20+
"compiled": {
21+
"result": "success",
22+
"isFeatureConstant": false,
23+
"isZoomConstant": true,
24+
"type": "string"
25+
},
26+
"outputs": [
27+
"MultiPoint"
28+
]
29+
}
30+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"expression": [
3+
"geometry-type"
4+
],
5+
"inputs": [
6+
[
7+
{},
8+
{
9+
"geometry": {
10+
"type": "MultiPolygon",
11+
"coordinates": [
12+
[
13+
[[0, 0], [5, 0], [5, 5], [0, 5], [0, 0]],
14+
[[1, 1], [1, 4], [4, 4], [4, 1], [1, 1]]
15+
],
16+
[
17+
[[2, 2], [3, 2], [3, 3], [2, 3], [2, 2]]
18+
]
19+
]
20+
}
21+
}
22+
]
23+
],
24+
"expected": {
25+
"compiled": {
26+
"result": "success",
27+
"isFeatureConstant": false,
28+
"isZoomConstant": true,
29+
"type": "string"
30+
},
31+
"outputs": [
32+
"MultiPolygon"
33+
]
34+
}
35+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"expression": [
3+
"geometry-type"
4+
],
5+
"inputs": [
6+
[
7+
{},
8+
{
9+
"geometry": {
10+
"type": "Point",
11+
"coordinates":
12+
[10, 0]
13+
}
14+
}
15+
]
16+
],
17+
"expected": {
18+
"compiled": {
19+
"result": "success",
20+
"isFeatureConstant": false,
21+
"isZoomConstant": true,
22+
"type": "string"
23+
},
24+
"outputs": [
25+
"Point"
26+
]
27+
}
28+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"expression": [
3+
"geometry-type"
4+
],
5+
"inputs": [
6+
[
7+
{},
8+
{
9+
"geometry": {
10+
"type": "Polygon",
11+
"coordinates": [
12+
[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]],
13+
[[1, 1], [1, 2], [2, 2], [2, 1], [1, 1]]
14+
]
15+
}
16+
}
17+
]
18+
],
19+
"expected": {
20+
"compiled": {
21+
"result": "success",
22+
"isFeatureConstant": false,
23+
"isZoomConstant": true,
24+
"type": "string"
25+
},
26+
"outputs": [
27+
"Polygon"
28+
]
29+
}
30+
}

test/integration/expression/tests/geometry-type/basic/test.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@
88
{
99
"geometry": {
1010
"type": "LineString",
11-
"coordinates": [
12-
[
13-
0,
14-
0
15-
],
16-
[
17-
10,
18-
0
19-
]
20-
]
11+
"coordinates":
12+
[[0, 0], [10, 0]]
2113
}
2214
}
2315
]
@@ -33,4 +25,4 @@
3325
"LineString"
3426
]
3527
}
36-
}
28+
}

0 commit comments

Comments
 (0)