Skip to content

Commit

Permalink
Merge pull request #4056 from pnorman/z_order_tests
Browse files Browse the repository at this point in the history
Add z_order tests
  • Loading branch information
pnorman authored Mar 7, 2020
2 parents aa17429 + b36ca93 commit 7efc965
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/lua/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ assert(z_order({foo="bar"}) == nil, "test failed: other tags")
assert(z_order({highway="motorway"}) == 380 , "test failed: motorway")
assert(z_order({highway="motorway", railway="rail"}) == 440 , "test failed: motorway + rail")

assert(z_order({highway="motorway"}) > z_order({highway="motorway_link"}) , "test failed: motorway_link")
assert(z_order({highway="trunk"}) > z_order({highway="trunk_link"}) , "test failed: trunk_link")
assert(z_order({highway="primary"}) > z_order({highway="primary_link"}) , "test failed: primary_link")
assert(z_order({highway="secondary"}) > z_order({highway="secondary_link"}) , "test failed: secondary_link")
assert(z_order({highway="tertiary"}) > z_order({highway="tertiary_link"}) , "test failed: tertiary_link")

assert(z_order({highway="motorway"}) > z_order({highway="trunk"}) , "test failed: motorway > trunk")
assert(z_order({highway="trunk"}) > z_order({highway="primary"}) , "test failed: trunk > primary")
assert(z_order({highway="primary"}) > z_order({highway="secondary"}) , "test failed: primary > secondary")
assert(z_order({highway="secondary"}) > z_order({highway="tertiary"}) , "test failed: secondary > tertiary")

print("TESTING: roads")
assert(roads({}) == 0, "test failed: no tags")
assert(roads({foo="bar"}) == 0, "test failed: other tags")
Expand Down

0 comments on commit 7efc965

Please sign in to comment.