Skip to content

Commit d690b4f

Browse files
committed
Cleanup tests checking Lua failures are caught
1 parent 33fb1c8 commit d690b4f

File tree

3 files changed

+24
-41
lines changed

3 files changed

+24
-41
lines changed

tests/data/test_output_flex_fail.lua

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
local test_table = osm2pgsql.define_table{
3+
name = 'osm2pgsql_test_polygon',
4+
ids = { type = 'area', id_column = 'osm_id' },
5+
columns = {
6+
{ column = 'tags', type = 'hstore' },
7+
{ column = 'geom', type = 'geometry' },
8+
{ column = 'area', type = 'area' },
9+
}
10+
}
11+
12+
function osm2pgsql.process_way(object)
13+
test_table:add_row({
14+
tags = object.tags
15+
-- missing geom transform here should lead to an error
16+
})
17+
end
18+

tests/test-output-flex-lua-fail.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55

66
static testing::db::import_t db;
77

8-
TEST_CASE("error in lua file")
8+
static char const *const conf_file = "test_output_flex_lua_fail.lua";
9+
10+
TEST_CASE("error in lua file is detected")
911
{
10-
REQUIRE_THROWS(
11-
db.run_file(testing::opt_t().slim().flex("test_output_flex_fail.lua"),
12-
"liechtenstein-2013-08-03.osm.pbf"));
13-
}
12+
options_t const options = testing::opt_t().flex(conf_file);
1413

14+
REQUIRE_THROWS(db.run_file(options, "liechtenstein-2013-08-03.osm.pbf"));
15+
}

0 commit comments

Comments
 (0)