Skip to content

Commit 41f2e56

Browse files
authored
Merge pull request #1813 from lonvia/more-bdd-tests
Convert next batch of tests to BDD tests
2 parents 456e433 + d9669bb commit 41f2e56

13 files changed

+1656
-1277
lines changed

tests/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ if (WITH_LUA)
9595
set_test(test-output-flex-types)
9696
set_test(test-output-flex-update)
9797
set_test(test-output-flex-validgeom)
98-
set_test(test-output-flex-way-add)
99-
set_test(test-output-flex-way-change)
100-
set_test(test-output-flex-way-del)
101-
set_test(test-output-flex-way-relation-add)
102-
set_test(test-output-flex-way-relation-del)
10398

10499
set_test(test-output-flex-example-configs)
105100
set(FLEX_EXAMPLE_CONFIGS "addresses,attributes,bbox,compatible,data-types,generic,geometries,places,route-relations,simple,unitable")

tests/bdd/flex/way-add.feature

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
Feature: Adding ways to a flex database
2+
3+
Background:
4+
Given the style file 'test_output_flex_way.lua'
5+
6+
Given the 0.1 grid
7+
| 11 | 13 | 15 | 17 | 19 |
8+
| 10 | 12 | 14 | 16 | 18 |
9+
10+
And the OSM data
11+
"""
12+
w11 v1 dV Tt1=yes Nn12,n13
13+
w12 v1 dV Tt2=yes Nn14,n15
14+
w13 v1 dV Ttboth=yes Nn16,n17
15+
w14 v1 dV Ttboth=yes Nn18,n19
16+
r30 v1 dV Tt=ag Mw11@,w12@mark,w13@,w14@mark
17+
"""
18+
When running osm2pgsql flex with parameters
19+
| --slim |
20+
21+
Then table osm2pgsql_test_t1 contains exactly
22+
| way_id |
23+
| 11 |
24+
Then table osm2pgsql_test_t2 contains exactly
25+
| way_id |
26+
| 12 |
27+
Then table osm2pgsql_test_tboth contains exactly
28+
| way_id |
29+
| 13 |
30+
| 14 |
31+
32+
33+
Scenario: way is not relevant
34+
Given the OSM data
35+
"""
36+
w10 v1 dV Tt=ag Nn10,n11
37+
r30 v2 dV Tt=ag Mw10@,w11@,w12@mark,w13@,w14@mark
38+
"""
39+
When running osm2pgsql flex with parameters
40+
| --slim | -a |
41+
42+
Then table osm2pgsql_test_t1 contains exactly
43+
| way_id |
44+
| 11 |
45+
Then table osm2pgsql_test_t2 contains exactly
46+
| way_id |
47+
| 12 |
48+
Then table osm2pgsql_test_tboth contains exactly
49+
| way_id |
50+
| 13 |
51+
| 14 |
52+
53+
54+
Scenario: add to t1
55+
Given the OSM data
56+
"""
57+
w10 v1 dV Tt1=yes Nn10,n11
58+
r30 v2 dV Tt=ag Mw10@,w11@,w12@mark,w13@,w14@mark
59+
"""
60+
When running osm2pgsql flex with parameters
61+
| --slim | -a |
62+
63+
Then table osm2pgsql_test_t1 contains exactly
64+
| way_id |
65+
| 10 |
66+
| 11 |
67+
Then table osm2pgsql_test_t2 contains exactly
68+
| way_id |
69+
| 12 |
70+
Then table osm2pgsql_test_tboth contains exactly
71+
| way_id |
72+
| 13 |
73+
| 14 |
74+
75+
76+
Scenario: add to t2
77+
Given the OSM data
78+
"""
79+
w10 v1 dV Tt2=yes Nn10,n11
80+
r30 v2 dV Tt=ag Mw10@mark,w11@,w12@mark,w13@,w14@mark
81+
"""
82+
When running osm2pgsql flex with parameters
83+
| --slim | -a |
84+
85+
Then table osm2pgsql_test_t1 contains exactly
86+
| way_id |
87+
| 11 |
88+
Then table osm2pgsql_test_t2 contains exactly
89+
| way_id | rel_ids |
90+
| 10 | {30} |
91+
| 12 | {30} |
92+
Then table osm2pgsql_test_tboth contains exactly
93+
| way_id |
94+
| 13 |
95+
| 14 |
96+
97+
98+
Scenario: add to t1 and t2
99+
Given the OSM data
100+
"""
101+
w10 v1 dV Tt1=yes,t2=yes Nn10,n11
102+
r30 v2 dV Tt=ag Mw10@mark,w11@,w12@mark,w13@,w14@mark
103+
"""
104+
When running osm2pgsql flex with parameters
105+
| --slim | -a |
106+
107+
Then table osm2pgsql_test_t1 contains exactly
108+
| way_id |
109+
| 10 |
110+
| 11 |
111+
Then table osm2pgsql_test_t2 contains exactly
112+
| way_id | rel_ids |
113+
| 10 | {30} |
114+
| 12 | {30} |
115+
Then table osm2pgsql_test_tboth contains exactly
116+
| way_id |
117+
| 13 |
118+
| 14 |
119+
120+
121+
Scenario: add to tboth (only stage1)
122+
Given the OSM data
123+
"""
124+
w10 v1 dV Ttboth=yes Nn10,n11
125+
r30 v2 dV Tt=ag Mw10@,w11@,w12@mark,w13@,w14@mark
126+
"""
127+
When running osm2pgsql flex with parameters
128+
| --slim | -a |
129+
130+
Then table osm2pgsql_test_t1 contains exactly
131+
| way_id |
132+
| 11 |
133+
Then table osm2pgsql_test_t2 contains exactly
134+
| way_id |
135+
| 12 |
136+
Then table osm2pgsql_test_tboth contains exactly
137+
| way_id | rel_ids |
138+
| 10 | NULL |
139+
| 13 | NULL |
140+
| 14 | {30} |
141+
142+
143+
Scenario: add to tboth (stage1 and stage2)
144+
Given the OSM data
145+
"""
146+
w10 v1 dV Ttboth=yes Nn10,n11
147+
r30 v2 dV Tt=ag Mw10@mark,w11@,w12@mark,w13@,w14@mark
148+
"""
149+
When running osm2pgsql flex with parameters
150+
| --slim | -a |
151+
152+
Then table osm2pgsql_test_t1 contains exactly
153+
| way_id |
154+
| 11 |
155+
Then table osm2pgsql_test_t2 contains exactly
156+
| way_id |
157+
| 12 |
158+
Then table osm2pgsql_test_tboth contains exactly
159+
| way_id | rel_ids |
160+
| 10 | {30} |
161+
| 13 | NULL |
162+
| 14 | {30} |

0 commit comments

Comments
 (0)