Skip to content

Commit 04dafe6

Browse files
committed
convert test-output-flex-way-del.cpp to BDD test
1 parent 8f7e9e5 commit 04dafe6

File tree

3 files changed

+349
-131
lines changed

3 files changed

+349
-131
lines changed

tests/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +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-del)
9998
set_test(test-output-flex-way-relation-add)
10099
set_test(test-output-flex-way-relation-del)
101100

tests/bdd/flex/way-del.feature

Lines changed: 349 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,349 @@
1+
Feature: Deleting ways in a 2-stage 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+
11+
Scenario: delete way which is not a member and not in tables
12+
Given the OSM data
13+
"""
14+
w10 v1 dV Tt=ag Nn10,n11
15+
w11 v1 dV Tt1=yes Nn12,n13
16+
w12 v1 dV Tt2=yes Nn14,n15
17+
w13 v1 dV Ttboth=yes Nn16,n17
18+
w14 v1 dV Ttboth=yes Nn18,n19
19+
r30 v1 dV Tt=ag Mw11@,w12@mark,w13@,w14@mark
20+
"""
21+
When running osm2pgsql flex with parameters
22+
| --slim |
23+
Then table osm2pgsql_test_t1 contains exactly
24+
| way_id |
25+
| 11 |
26+
Then table osm2pgsql_test_t2 contains exactly
27+
| way_id |
28+
| 12 |
29+
Then table osm2pgsql_test_tboth contains exactly
30+
| way_id |
31+
| 13 |
32+
| 14 |
33+
34+
Given the OSM data
35+
"""
36+
w10 v2 dD
37+
"""
38+
When running osm2pgsql flex with parameters
39+
| --slim | -a |
40+
Then table osm2pgsql_test_t1 contains exactly
41+
| way_id |
42+
| 11 |
43+
Then table osm2pgsql_test_t2 contains exactly
44+
| way_id |
45+
| 12 |
46+
Then table osm2pgsql_test_tboth contains exactly
47+
| way_id |
48+
| 13 |
49+
| 14 |
50+
51+
52+
Scenario: delete way which is not a member and in t1 table
53+
Given the OSM data
54+
"""
55+
w10 v1 dV Tt1=yes Nn10,n11
56+
w11 v1 dV Tt1=yes Nn12,n13
57+
w12 v1 dV Tt2=yes Nn14,n15
58+
w13 v1 dV Ttboth=yes Nn16,n17
59+
w14 v1 dV Ttboth=yes Nn18,n19
60+
r30 v1 dV Tt=ag Mw11@,w12@mark,w13@,w14@mark
61+
"""
62+
When running osm2pgsql flex with parameters
63+
| --slim |
64+
Then table osm2pgsql_test_t1 contains exactly
65+
| way_id |
66+
| 10 |
67+
| 11 |
68+
Then table osm2pgsql_test_t2 contains exactly
69+
| way_id |
70+
| 12 |
71+
Then table osm2pgsql_test_tboth contains exactly
72+
| way_id |
73+
| 13 |
74+
| 14 |
75+
76+
Given the OSM data
77+
"""
78+
w10 v2 dD
79+
"""
80+
When running osm2pgsql flex with parameters
81+
| --slim | -a |
82+
Then table osm2pgsql_test_t1 contains exactly
83+
| way_id |
84+
| 11 |
85+
Then table osm2pgsql_test_t2 contains exactly
86+
| way_id |
87+
| 12 |
88+
Then table osm2pgsql_test_tboth contains exactly
89+
| way_id |
90+
| 13 |
91+
| 14 |
92+
93+
94+
Scenario: delete way which is not a member and in tboth table
95+
Given the OSM data
96+
"""
97+
w10 v1 dV Ttboth=yes Nn10,n11
98+
w11 v1 dV Tt1=yes Nn12,n13
99+
w12 v1 dV Tt2=yes Nn14,n15
100+
w13 v1 dV Ttboth=yes Nn16,n17
101+
w14 v1 dV Ttboth=yes Nn18,n19
102+
r30 v1 dV Tt=ag Mw11@,w12@mark,w13@,w14@mark
103+
"""
104+
When running osm2pgsql flex with parameters
105+
| --slim |
106+
Then table osm2pgsql_test_t1 contains exactly
107+
| way_id |
108+
| 11 |
109+
Then table osm2pgsql_test_t2 contains exactly
110+
| way_id |
111+
| 12 |
112+
Then table osm2pgsql_test_tboth contains exactly
113+
| way_id |
114+
| 10 |
115+
| 13 |
116+
| 14 |
117+
118+
Given the OSM data
119+
"""
120+
w10 v2 dD
121+
"""
122+
When running osm2pgsql flex with parameters
123+
| --slim | -a |
124+
Then table osm2pgsql_test_t1 contains exactly
125+
| way_id |
126+
| 11 |
127+
Then table osm2pgsql_test_t2 contains exactly
128+
| way_id |
129+
| 12 |
130+
Then table osm2pgsql_test_tboth contains exactly
131+
| way_id |
132+
| 13 |
133+
| 14 |
134+
135+
136+
Scenario: delete way which is a member and not in tables
137+
Given the OSM data
138+
"""
139+
w10 v1 dV Tt=ag Nn10,n11
140+
w11 v1 dV Tt1=yes Nn12,n13
141+
w12 v1 dV Tt2=yes Nn14,n15
142+
w13 v1 dV Ttboth=yes Nn16,n17
143+
w14 v1 dV Ttboth=yes Nn18,n19
144+
r30 v1 dV Tt=ag Mw10@,w11@,w12@mark,w13@,w14@mark
145+
"""
146+
When running osm2pgsql flex with parameters
147+
| --slim |
148+
Then table osm2pgsql_test_t1 contains exactly
149+
| way_id |
150+
| 11 |
151+
Then table osm2pgsql_test_t2 contains exactly
152+
| way_id |
153+
| 12 |
154+
Then table osm2pgsql_test_tboth contains exactly
155+
| way_id |
156+
| 13 |
157+
| 14 |
158+
159+
Given the OSM data
160+
"""
161+
w10 v2 dD
162+
"""
163+
When running osm2pgsql flex with parameters
164+
| --slim | -a |
165+
Then table osm2pgsql_test_t1 contains exactly
166+
| way_id |
167+
| 11 |
168+
Then table osm2pgsql_test_t2 contains exactly
169+
| way_id |
170+
| 12 |
171+
Then table osm2pgsql_test_tboth contains exactly
172+
| way_id |
173+
| 13 |
174+
| 14 |
175+
176+
177+
Scenario: delete way which is a member and in t1 table
178+
Given the OSM data
179+
"""
180+
w10 v1 dV Tt1=yes Nn10,n11
181+
w11 v1 dV Tt1=yes Nn12,n13
182+
w12 v1 dV Tt2=yes Nn14,n15
183+
w13 v1 dV Ttboth=yes Nn16,n17
184+
w14 v1 dV Ttboth=yes Nn18,n19
185+
r30 v1 dV Tt=ag Mw10@,w11@,w12@mark,w13@,w14@mark
186+
"""
187+
When running osm2pgsql flex with parameters
188+
| --slim |
189+
Then table osm2pgsql_test_t1 contains exactly
190+
| way_id |
191+
| 10 |
192+
| 11 |
193+
Then table osm2pgsql_test_t2 contains exactly
194+
| way_id |
195+
| 12 |
196+
Then table osm2pgsql_test_tboth contains exactly
197+
| way_id |
198+
| 13 |
199+
| 14 |
200+
201+
Given the OSM data
202+
"""
203+
w10 v2 dD
204+
"""
205+
When running osm2pgsql flex with parameters
206+
| --slim | -a |
207+
Then table osm2pgsql_test_t1 contains exactly
208+
| way_id |
209+
| 11 |
210+
Then table osm2pgsql_test_t2 contains exactly
211+
| way_id |
212+
| 12 |
213+
Then table osm2pgsql_test_tboth contains exactly
214+
| way_id |
215+
| 13 |
216+
| 14 |
217+
218+
219+
Scenario: delete way which is a member and in t2 table
220+
Given the OSM data
221+
"""
222+
w10 v1 dV Tt2=yes Nn10,n11
223+
w11 v1 dV Tt1=yes Nn12,n13
224+
w12 v1 dV Tt2=yes Nn14,n15
225+
w13 v1 dV Ttboth=yes Nn16,n17
226+
w14 v1 dV Ttboth=yes Nn18,n19
227+
r30 v1 dV Tt=ag Mw10@mark,w11@,w12@mark,w13@,w14@mark
228+
"""
229+
When running osm2pgsql flex with parameters
230+
| --slim |
231+
Then table osm2pgsql_test_t1 contains exactly
232+
| way_id |
233+
| 11 |
234+
Then table osm2pgsql_test_t2 contains exactly
235+
| way_id |
236+
| 10 |
237+
| 12 |
238+
Then table osm2pgsql_test_tboth contains exactly
239+
| way_id |
240+
| 13 |
241+
| 14 |
242+
243+
Given the OSM data
244+
"""
245+
w10 v2 dD
246+
"""
247+
When running osm2pgsql flex with parameters
248+
| --slim | -a |
249+
Then table osm2pgsql_test_t1 contains exactly
250+
| way_id |
251+
| 11 |
252+
Then table osm2pgsql_test_t2 contains exactly
253+
| way_id |
254+
| 12 |
255+
Then table osm2pgsql_test_tboth contains exactly
256+
| way_id |
257+
| 13 |
258+
| 14 |
259+
260+
261+
Scenario: delete way which is a member and in t1+t2 tables
262+
Given the OSM data
263+
"""
264+
w10 v1 dV Tt1=yes,t2=yes Nn10,n11
265+
w11 v1 dV Tt1=yes Nn12,n13
266+
w12 v1 dV Tt2=yes Nn14,n15
267+
w13 v1 dV Ttboth=yes Nn16,n17
268+
w14 v1 dV Ttboth=yes Nn18,n19
269+
r30 v1 dV Tt=ag Mw10@mark,w11@,w12@mark,w13@,w14@mark
270+
"""
271+
When running osm2pgsql flex with parameters
272+
| --slim |
273+
Then table osm2pgsql_test_t1 contains exactly
274+
| way_id |
275+
| 10 |
276+
| 11 |
277+
Then table osm2pgsql_test_t2 contains exactly
278+
| way_id |
279+
| 10 |
280+
| 12 |
281+
Then table osm2pgsql_test_tboth contains exactly
282+
| way_id |
283+
| 13 |
284+
| 14 |
285+
286+
Given the OSM data
287+
"""
288+
w10 v2 dD
289+
"""
290+
When running osm2pgsql flex with parameters
291+
| --slim | -a |
292+
Then table osm2pgsql_test_t1 contains exactly
293+
| way_id |
294+
| 11 |
295+
Then table osm2pgsql_test_t2 contains exactly
296+
| way_id |
297+
| 12 |
298+
Then table osm2pgsql_test_tboth contains exactly
299+
| way_id |
300+
| 13 |
301+
| 14 |
302+
303+
304+
Scenario Outline: delete way which is a member and in tboth table
305+
Given the OSM data
306+
"""
307+
w10 v1 dV Ttboth=yes Nn10,n11
308+
w11 v1 dV Tt1=yes Nn12,n13
309+
w12 v1 dV Tt2=yes Nn14,n15
310+
w13 v1 dV Ttboth=yes Nn16,n17
311+
w14 v1 dV Ttboth=yes Nn18,n19
312+
r30 v1 dV Tt=ag Mw10@<role>,w11@,w12@mark,w13@,w14@mark
313+
"""
314+
When running osm2pgsql flex with parameters
315+
| --slim |
316+
Then table osm2pgsql_test_t1 contains exactly
317+
| way_id |
318+
| 11 |
319+
Then table osm2pgsql_test_t2 contains exactly
320+
| way_id |
321+
| 12 |
322+
Then table osm2pgsql_test_tboth contains exactly
323+
| way_id |
324+
| 10 |
325+
| 13 |
326+
| 14 |
327+
328+
Given the OSM data
329+
"""
330+
w10 v2 dD
331+
"""
332+
When running osm2pgsql flex with parameters
333+
| --slim | -a |
334+
Then table osm2pgsql_test_t1 contains exactly
335+
| way_id |
336+
| 11 |
337+
Then table osm2pgsql_test_t2 contains exactly
338+
| way_id |
339+
| 12 |
340+
Then table osm2pgsql_test_tboth contains exactly
341+
| way_id |
342+
| 13 |
343+
| 14 |
344+
345+
346+
Examples:
347+
| role |
348+
| mark |
349+
| |

0 commit comments

Comments
 (0)