From 1ad274ed2ec9ef5fc32ab53ed7b56dbb3edea363 Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Mon, 1 Oct 2012 13:27:08 +0200 Subject: [PATCH] more reorganizing of tests --- features/bicycle/access.feature | 10 ++--- features/bicycle/barrier.feature | 4 +- features/bicycle/destination.feature | 8 ++-- features/bicycle/ferry.feature | 4 +- features/bicycle/names.feature | 8 ++-- features/bicycle/oneway.feature | 20 ++++----- features/bicycle/restrictions.feature | 18 ++++---- features/bicycle/way.feature | 4 +- features/car/access.feature | 12 +++--- features/car/barrier.feature | 6 +-- features/car/destination.feature | 8 ++-- features/car/ferry.feature | 4 +- features/car/names.feature | 8 ++-- features/car/oneway.feature | 10 ++--- features/car/restrictions.feature | 18 ++++---- features/car/way.feature | 6 +-- features/foot/oneway.feature | 10 ++--- features/foot/way.feature | 4 +- features/general/weird.feature | 39 ----------------- features/investigate/weird.feature | 42 +++++++++++++++++++ features/{general => testbot}/bad.feature | 3 ++ features/{general => testbot}/basic.feature | 42 ++++++++++++++++++- features/{general => testbot}/bearing.feature | 5 ++- .../{general => testbot}/distance.feature | 5 ++- features/{general => testbot}/origin.feature | 4 +- features/{general => testbot}/penalty.feature | 2 +- .../{general => testbot}/planetary.feature | 2 +- features/{general => testbot}/snap.feature | 3 ++ features/{general => testbot}/time.feature | 5 --- features/{general => testbot}/utf.feature | 5 ++- features/{general => testbot}/weight.feature | 0 profiles/testbot.lua | 14 ++++++- 32 files changed, 197 insertions(+), 136 deletions(-) delete mode 100644 features/general/weird.feature create mode 100644 features/investigate/weird.feature rename features/{general => testbot}/bad.feature (97%) rename features/{general => testbot}/basic.feature (77%) rename features/{general => testbot}/bearing.feature (98%) rename features/{general => testbot}/distance.feature (99%) rename features/{general => testbot}/origin.feature (95%) rename features/{general => testbot}/penalty.feature (99%) rename features/{general => testbot}/planetary.feature (95%) rename features/{general => testbot}/snap.feature (98%) rename features/{general => testbot}/time.feature (98%) rename features/{general => testbot}/utf.feature (85%) rename features/{general => testbot}/weight.feature (100%) diff --git a/features/bicycle/access.feature b/features/bicycle/access.feature index 4e13b6dde..0f53e0522 100644 --- a/features/bicycle/access.feature +++ b/features/bicycle/access.feature @@ -1,10 +1,10 @@ @routing @bicycle @access -Feature: Restricted access +Feature: Bike - Restricted access Background: Given the speedprofile "bicycle" - Scenario: Access tags on ways + Scenario: Bike - Access tags on ways Then routability should be | access | bothw | | yes | x | @@ -20,7 +20,7 @@ Feature: Restricted access | designated | | | some_tag | x | - Scenario: Access tags for other modes should have no effect + Scenario: Bike - Access tags for other modes should have no effect Then routability should be | access | bothw | | ufo:yes | x | @@ -36,7 +36,7 @@ Feature: Restricted access | ufo:designated | x | | ufo:some_tag | x | - Scenario: Access tags on nodes + Scenario: Bike - Access tags on nodes Then routability should be | node:access | bothw | | yes | x | @@ -52,7 +52,7 @@ Feature: Restricted access | designated | | | some_tag | x | - Scenario: Access tags on both nodes and way + Scenario: Bike - Access tags on both nodes and way Then routability should be | access | node:access | bothw | | yes | yes | x | diff --git a/features/bicycle/barrier.feature b/features/bicycle/barrier.feature index 5ab4d5a8d..d6c89e9af 100644 --- a/features/bicycle/barrier.feature +++ b/features/bicycle/barrier.feature @@ -4,7 +4,7 @@ Feature: Barriers Background: Given the speedprofile "bicycle" - Scenario: Barriers + Scenario: Bike - Barriers Then routability should be | highway | node/barrier | node/access | bothw | | primary | | | x | @@ -16,7 +16,7 @@ Feature: Barriers | primary | bollard | | x | | primary | some_tag | | | - Scenario: Access tag trumphs barriers + Scenario: Bike - Access tag trumphs barriers Then routability should be | highway | node/barrier | node/access | bothw | | primary | bollard | yes | x | diff --git a/features/bicycle/destination.feature b/features/bicycle/destination.feature index 0beefe6ca..af3f67af0 100644 --- a/features/bicycle/destination.feature +++ b/features/bicycle/destination.feature @@ -1,10 +1,10 @@ @routing @bicycle @destination -Feature: Destination only, no passing through +Feature: Bike - Destination only, no passing through Background: Given the speedprofile "bicycle" - Scenario: Destination only street + Scenario: Bike - Destination only street Given the node map | a | | | | | | | b | c | d | | @@ -31,7 +31,7 @@ Feature: Destination only, no passing through | d | c | bcd | | d | b | bcd | - Scenario: Series of destination only streets + Scenario: Bike - Series of destination only streets Given the node map | a | | c | | e | | | b | | d | | @@ -50,7 +50,7 @@ Feature: Destination only, no passing through | a | d | ab | | a | e | ab | - Scenario: Routing inside a destination only area + Scenario: Bike - Routing inside a destination only area Given the node map | a | | c | | e | | | b | | d | | diff --git a/features/bicycle/ferry.feature b/features/bicycle/ferry.feature index 22a0f24a9..e7846f64d 100644 --- a/features/bicycle/ferry.feature +++ b/features/bicycle/ferry.feature @@ -1,10 +1,10 @@ @routing @bicycle @ferry -Feature: Handle ferry routes +Feature: Bike - Handle ferry routes Background: Given the speedprofile "bicycle" - Scenario: Use a ferry route + Scenario: Bike - Use a ferry route Given the node map | a | b | c | | | | | | d | | | diff --git a/features/bicycle/names.feature b/features/bicycle/names.feature index 1c21901a8..9bc8dad2d 100644 --- a/features/bicycle/names.feature +++ b/features/bicycle/names.feature @@ -1,10 +1,10 @@ @routing @bicycle @names -Feature: Street names in instructions +Feature: Bike - Street names in instructions Background: Given the speedprofile "bicycle" - Scenario: A named street + Scenario: Bike - A named street Given the node map | a | b | | | c | @@ -18,7 +18,7 @@ Feature: Street names in instructions | from | to | route | | a | c | My Way,Your Way | - Scenario: Use way type to describe unnamed ways + Scenario: Bike - Use way type to describe unnamed ways Given the node map | a | b | c | @@ -31,7 +31,7 @@ Feature: Street names in instructions | from | to | route | | a | c | cycleway,track | - Scenario: Don't create instructions for every node of unnamed ways + Scenario: Bike - Don't create instructions for every node of unnamed ways Given the node map | a | b | c | d | diff --git a/features/bicycle/oneway.feature b/features/bicycle/oneway.feature index 98cb2cefe..011a5180f 100644 --- a/features/bicycle/oneway.feature +++ b/features/bicycle/oneway.feature @@ -1,11 +1,11 @@ @routing @bicycle @oneway -Feature: Oneway streets +Feature: Bike - Oneway streets Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing Background: Given the speedprofile "bicycle" - Scenario: Simple oneway + Scenario: Bike - Simple oneway Then routability should be | highway | oneway | forw | backw | | primary | yes | x | | @@ -15,7 +15,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | highway | oneway | forw | backw | | primary | -1 | | x | - Scenario: Around the Block + Scenario: Bike - Around the Block Given the node map | a | b | | d | c | @@ -32,7 +32,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | a | b | ab | | b | a | bc,cd,da | - Scenario: Handle various oneway tag values + Scenario: Bike - Handle various oneway tag values Then routability should be | oneway | forw | backw | | | x | x | @@ -45,7 +45,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | 1 | x | | | -1 | | x | - Scenario: Implied oneways + Scenario: Bike - Implied oneways Then routability should be | junction | forw | backw | | | x | x | @@ -60,7 +60,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | roundabout | x | | | roundabout | x | | - Scenario: Overriding implied oneways + Scenario: Bike - Overriding implied oneways Then routability should be | highway | junction | oneway | forw | backw | | primary | roundabout | no | x | x | @@ -69,8 +69,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | trunk_link | | -1 | | | | primary | roundabout | -1 | | x | - @bicycle - Scenario: Oneway:bicycle should override normal oneways tags + Scenario: Bike - Oneway:bicycle should override normal oneways tags Then routability should be | oneway:bicycle | oneway | junction | forw | backw | | yes | | | x | | @@ -89,8 +88,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | -1 | -1 | | | x | | -1 | | roundabout | | x | - @bicycle - Scenario: Bicycles and contra flow + Scenario: Bike - Contra flow Then routability should be | oneway | cycleway | forw | backw | | yes | opposite | x | x | @@ -103,7 +101,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | no | opposite_track | x | x | | no | opposite_lane | x | x | - Scenario: Bikes should not be affected by car tags + Scenario: Bike - Should not be affected by car tags Then routability should be | junction | oneway | oneway:car | forw | backw | | | yes | yes | x | | diff --git a/features/bicycle/restrictions.feature b/features/bicycle/restrictions.feature index 8a11ef8d9..c21ae8b90 100644 --- a/features/bicycle/restrictions.feature +++ b/features/bicycle/restrictions.feature @@ -1,5 +1,5 @@ @routing @bicycle @restrictions -Feature: Turn restrictions +Feature: Bike - Turn restrictions Handle turn restrictions as defined by http://wiki.openstreetmap.org/wiki/Relation:restriction Note that if u-turns are allowed, turn restrictions can lead to suprising, but correct, routes. @@ -7,7 +7,7 @@ Feature: Turn restrictions Given the speedprofile "bicycle" @no_turning - Scenario: No left turn + Scenario: Bike - No left turn Given the node map | | n | | | w | j | e | @@ -31,7 +31,7 @@ Feature: Turn restrictions | s | e | sj,ej | @no_turning - Scenario: No right turn + Scenario: Bike - No right turn Given the node map | | n | | | w | j | e | @@ -55,7 +55,7 @@ Feature: Turn restrictions | s | e | | @no_turning - Scenario: No u-turn + Scenario: Bike - No u-turn Given the node map | | n | | | w | j | e | @@ -79,7 +79,7 @@ Feature: Turn restrictions | s | e | sj,ej | @no_turning - Scenario: Handle any no_* relation + Scenario: Bike - Handle any no_* relation Given the node map | | n | | | w | j | e | @@ -103,7 +103,7 @@ Feature: Turn restrictions | s | e | sj,ej | @only_turning - Scenario: Only left turn + Scenario: Bike - Only left turn Given the node map | | n | | | w | j | e | @@ -127,7 +127,7 @@ Feature: Turn restrictions | s | e | | @only_turning - Scenario: Only right turn + Scenario: Bike - Only right turn Given the node map | | n | | | w | j | e | @@ -151,7 +151,7 @@ Feature: Turn restrictions | s | e | sj,ej | @only_turning - Scenario: Only straight on + Scenario: Bike - Only straight on Given the node map | | n | | | w | j | e | @@ -175,7 +175,7 @@ Feature: Turn restrictions | s | e | | @no_turning - Scenario: Handle any only_* restriction + Scenario: Bike - Handle any only_* restriction Given the node map | | n | | | w | j | e | diff --git a/features/bicycle/way.feature b/features/bicycle/way.feature index c6fc112a4..262448cc4 100644 --- a/features/bicycle/way.feature +++ b/features/bicycle/way.feature @@ -1,10 +1,10 @@ @routing @bicycle @way -Feature: Accessability of different way types +Feature: Bike - Accessability of different way types Background: Given the speedprofile "bicycle" - Scenario: Basic access for bicycles + Scenario: Bike - Basic access Bikes are allowed on footways etc because you can pull your bike at a lower speed. Given the speedprofile "bicycle" Then routability should be diff --git a/features/car/access.feature b/features/car/access.feature index a8a8df8ed..afccfa723 100644 --- a/features/car/access.feature +++ b/features/car/access.feature @@ -1,10 +1,10 @@ @routing @car @access -Feature: Restricted access +Feature: Car - Restricted access Background: Given the speedprofile "car" - Scenario: Access tags on ways + Scenario: Car - Access tags on ways Then routability should be | access | bothw | | yes | x | @@ -20,7 +20,7 @@ Feature: Restricted access | designated | | | some_tag | x | - Scenario: Access tags for other modes should have no effect + Scenario: Car - Access tags for other modes should have no effect Then routability should be | access | bothw | | ufo:yes | x | @@ -36,7 +36,7 @@ Feature: Restricted access | ufo:designated | x | | ufo:some_tag | x | - Scenario: Access tags on nodes + Scenario: Car - Access tags on nodes Then routability should be | node:access | bothw | | yes | x | @@ -52,7 +52,7 @@ Feature: Restricted access | designated | | | some_tag | x | - Scenario: Access tags on both nodes and way + Scenario: Car - Access tags on both nodes and way Then routability should be | access | node:access | bothw | | yes | yes | x | @@ -63,4 +63,4 @@ Feature: Restricted access | no | some_tag | | | some_tag | yes | | | some_tag | no | | - | some_tag | some_tag | | + | some_tag | some_tag | | \ No newline at end of file diff --git a/features/car/barrier.feature b/features/car/barrier.feature index 5994f9bf1..03772f9ad 100644 --- a/features/car/barrier.feature +++ b/features/car/barrier.feature @@ -1,10 +1,10 @@ @routing @car @barrier -Feature: Barriers +Feature: Car - Barriers Background: Given the speedprofile "car" - Scenario: Barriers + Scenario: Car - Barriers Then routability should be | highway | node/barrier | node/access | bothw | | primary | | | x | @@ -16,7 +16,7 @@ Feature: Barriers | primary | bollard | | | | primary | some_tag | | | - Scenario: Access tag trumphs barriers + Scenario: Car - Access tag trumphs barriers Then routability should be | highway | node/barrier | node/access | bothw | | primary | bollard | yes | x | diff --git a/features/car/destination.feature b/features/car/destination.feature index 95f2a340d..961bbc176 100644 --- a/features/car/destination.feature +++ b/features/car/destination.feature @@ -1,10 +1,10 @@ @routing @car @destination -Feature: Destination only, no passing through +Feature: Car - Destination only, no passing through Background: Given the speedprofile "car" - Scenario: Destination only street + Scenario: Car - Destination only street Given the node map | a | | | | | | | b | c | d | | @@ -31,7 +31,7 @@ Feature: Destination only, no passing through | d | c | bcd | | d | b | bcd | - Scenario: Series of destination only streets + Scenario: Car - Series of destination only streets Given the node map | a | | c | | e | | | b | | d | | @@ -50,7 +50,7 @@ Feature: Destination only, no passing through | a | d | ab | | a | e | ab | - Scenario: Routing inside a destination only area + Scenario: Car - Routing inside a destination only area Given the node map | a | | c | | e | | | b | | d | | diff --git a/features/car/ferry.feature b/features/car/ferry.feature index 98004942c..4b1caf583 100644 --- a/features/car/ferry.feature +++ b/features/car/ferry.feature @@ -1,10 +1,10 @@ @routing @car @ferry -Feature: Handle ferry routes +Feature: Car - Handle ferry routes Background: Given the speedprofile "car" - Scenario: Use a ferry route + Scenario: Car - Use a ferry route Given the node map | a | b | c | | | | | | d | | | diff --git a/features/car/names.feature b/features/car/names.feature index 35c738d03..d937b3855 100644 --- a/features/car/names.feature +++ b/features/car/names.feature @@ -1,10 +1,10 @@ @routing @car @names -Feature: Street names in instructions +Feature: Car - Street names in instructions Background: Given the speedprofile "car" - Scenario: A named street + Scenario: Car - A named street Given the node map | a | b | | | c | @@ -18,7 +18,7 @@ Feature: Street names in instructions | from | to | route | | a | c | My Way,Your Way | - Scenario: Use way type to describe unnamed ways + Scenario: Car - Use way type to describe unnamed ways Given the node map | a | b | c | @@ -31,7 +31,7 @@ Feature: Street names in instructions | from | to | route | | a | c | tertiary,residential | - Scenario: Don't create instructions for every node of unnamed ways + Scenario: Car - Don't create instructions for every node of unnamed ways Given the node map | a | b | c | d | diff --git a/features/car/oneway.feature b/features/car/oneway.feature index c9c02d791..134b43a30 100644 --- a/features/car/oneway.feature +++ b/features/car/oneway.feature @@ -1,21 +1,21 @@ @routing @car @oneway -Feature: Oneway streets +Feature: Car - Oneway streets Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing Background: Given the speedprofile "car" - Scenario: Simple oneway + Scenario: Car - Simple oneway Then routability should be | highway | oneway | forw | backw | | primary | yes | x | | - Scenario: Simple reverse oneway + Scenario: Car - Simple reverse oneway Then routability should be | highway | oneway | forw | backw | | primary | -1 | | x | - Scenario: Around the Block + Scenario: Car - Around the Block Given the node map | a | b | | d | c | @@ -32,7 +32,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | a | b | ab | | b | a | bc,cd,da | - Scenario: Cars should not be affected by bicycle tags + Scenario: Car - Cars should not be affected by bicycle tags Then routability should be | highway | junction | oneway | oneway:bicycle | forw | backw | | primary | | yes | yes | x | | diff --git a/features/car/restrictions.feature b/features/car/restrictions.feature index acd871d4e..9f2c69f56 100644 --- a/features/car/restrictions.feature +++ b/features/car/restrictions.feature @@ -1,5 +1,5 @@ @routing @car @restrictions -Feature: Turn restrictions +Feature: Car - Turn restrictions Handle turn restrictions as defined by http://wiki.openstreetmap.org/wiki/Relation:restriction Note that if u-turns are allowed, turn restrictions can lead to suprising, but correct, routes. @@ -7,7 +7,7 @@ Feature: Turn restrictions Given the speedprofile "car" @no_turning - Scenario: No left turn + Scenario: Car - No left turn Given the node map | | n | | | w | j | e | @@ -31,7 +31,7 @@ Feature: Turn restrictions | s | e | sj,ej | @no_turning - Scenario: No right turn + Scenario: Car - No right turn Given the node map | | n | | | w | j | e | @@ -55,7 +55,7 @@ Feature: Turn restrictions | s | e | | @no_turning - Scenario: No u-turn + Scenario: Car - No u-turn Given the node map | | n | | | w | j | e | @@ -79,7 +79,7 @@ Feature: Turn restrictions | s | e | sj,ej | @no_turning - Scenario: Handle any no_* relation + Scenario: Car - Handle any no_* relation Given the node map | | n | | | w | j | e | @@ -103,7 +103,7 @@ Feature: Turn restrictions | s | e | sj,ej | @only_turning - Scenario: Only left turn + Scenario: Car - Only left turn Given the node map | | n | | | w | j | e | @@ -127,7 +127,7 @@ Feature: Turn restrictions | s | e | | @only_turning - Scenario: Only right turn + Scenario: Car - Only right turn Given the node map | | n | | | w | j | e | @@ -151,7 +151,7 @@ Feature: Turn restrictions | s | e | sj,ej | @only_turning - Scenario: Only straight on + Scenario: Car - Only straight on Given the node map | | n | | | w | j | e | @@ -175,7 +175,7 @@ Feature: Turn restrictions | s | e | | @no_turning - Scenario: Handle any only_* restriction + Scenario: Car - Handle any only_* restriction Given the node map | | n | | | w | j | e | diff --git a/features/car/way.feature b/features/car/way.feature index 00eedf9c5..8fed7213c 100644 --- a/features/car/way.feature +++ b/features/car/way.feature @@ -1,10 +1,10 @@ @routing @car @way -Feature: Accessability of different way types +Feature: Car - Accessability of different way types Background: Given the speedprofile "car" - Scenario: Basic access for cars + Scenario: Car - Basic access Then routability should be | highway | forw | | motorway | x | @@ -29,4 +29,4 @@ Feature: Accessability of different way types | steps | | | pier | | | cycleway | | - | bridleway | | + | bridleway | | \ No newline at end of file diff --git a/features/foot/oneway.feature b/features/foot/oneway.feature index 93b13b136..498ba177e 100644 --- a/features/foot/oneway.feature +++ b/features/foot/oneway.feature @@ -1,11 +1,11 @@ @routing @foot @oneway -Feature: Oneway streets +Feature: Foot - Oneway streets Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing Background: Given the speedprofile "foot" - Scenario: Walking should not be affected by oneways + Scenario: Foot - Walking should not be affected by oneways Then routability should be | oneway | bothw | | | x | @@ -18,12 +18,12 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | 1 | x | | -1 | x | - Scenario: Walking and roundabouts + Scenario: Foot - Walking and roundabouts Then routability should be | junction | bothw | | roundarout | x | - Scenario: Oneway:foot tag should not cause walking on big roads + Scenario: Foot - Oneway:foot tag should not cause walking on big roads Then routability should be | highway | oneway:foot | bothw | | motorway | yes | | @@ -39,7 +39,7 @@ Handle oneways streets, as defined at http://wiki.openstreetmap.org/wiki/OSM_tag | trunk | -1 | | | trunk_link | -1 | | - Scenario: Walking should respect oneway:foot + Scenario: Foot - Walking should respect oneway:foot Then routability should be | oneway:foot | oneway | junction | forw | backw | | yes | | | x | | diff --git a/features/foot/way.feature b/features/foot/way.feature index 5b50ccb54..6523358c2 100644 --- a/features/foot/way.feature +++ b/features/foot/way.feature @@ -1,10 +1,10 @@ @routing @foot @way -Feature: Accessability of different way types +Feature: Foot - Accessability of different way types Background: Given the speedprofile "foot" - Scenario: Basic access for walking + Scenario: Foot - Basic access Then routability should be | highway | forw | | motorway | | diff --git a/features/general/weird.feature b/features/general/weird.feature deleted file mode 100644 index 0922f5e06..000000000 --- a/features/general/weird.feature +++ /dev/null @@ -1,39 +0,0 @@ -@routing @weird -Feature: Weird routings discovered - -Scenario: Routing on a oneway roundabout - Given the node map - | | d | c | | - | e | | | b | - | f | | | a | - | | g | h | | - - And the ways - | nodes | oneway | - | ab | yes | - | bc | yes | - | cd | yes | - | de | yes | - | ef | yes | - | fg | yes | - | gh | yes | - | ha | yes | - - When I route I should get - | from | to | route | - | a | b | ab | - | b | c | bc | - | c | d | cd | - | d | e | de | - | e | f | ef | - | f | g | fg | - | g | h | gh | - | h | a | ha | - | b | a | bc,cd,de,ef,fg,gh,ha | - | c | b | cd,de,ef,fg,gh,ha,ab | - | d | c | de,ef,fg,gh,ha,ab,bc | - | e | d | ef,fg,gh,ha,ab,bc,cd | - | f | e | fg,gh,ha,ab,bc,cd,de | - | g | f | gh,ha,ab,bc,cd,de,ef | - | h | g | ha,ab,bc,cd,de,ef,fg | - | a | h | ab,bc,cd,de,ef,fg,gh | diff --git a/features/investigate/weird.feature b/features/investigate/weird.feature new file mode 100644 index 000000000..7c4cbcfd7 --- /dev/null +++ b/features/investigate/weird.feature @@ -0,0 +1,42 @@ +@routing @weird +Feature: Weird routings discovered + + Background: + Given the speedprofile "testbot" + + Scenario: Routing on a oneway roundabout + Given the node map + | | d | c | | + | e | | | b | + | f | | | a | + | | g | h | | + + And the ways + | nodes | oneway | + | ab | yes | + | bc | yes | + | cd | yes | + | de | yes | + | ef | yes | + | fg | yes | + | gh | yes | + | ha | yes | + + When I route I should get + | from | to | route | + | a | b | ab | + | b | c | bc | + | c | d | cd | + | d | e | de | + | e | f | ef | + | f | g | fg | + | g | h | gh | + | h | a | ha | + | b | a | bc,cd,de,ef,fg,gh,ha | + | c | b | cd,de,ef,fg,gh,ha,ab | + | d | c | de,ef,fg,gh,ha,ab,bc | + | e | d | ef,fg,gh,ha,ab,bc,cd | + | f | e | fg,gh,ha,ab,bc,cd,de | + | g | f | gh,ha,ab,bc,cd,de,ef | + | h | g | ha,ab,bc,cd,de,ef,fg | + | a | h | ab,bc,cd,de,ef,fg,gh | \ No newline at end of file diff --git a/features/general/bad.feature b/features/testbot/bad.feature similarity index 97% rename from features/general/bad.feature rename to features/testbot/bad.feature index af1f46c65..01a1a35c3 100644 --- a/features/general/bad.feature +++ b/features/testbot/bad.feature @@ -1,6 +1,9 @@ @routing @bad Feature: Handle bad data in a graceful manner + Background: + Given the speedprofile "testbot" + Scenario: Empty dataset Given the node map | | diff --git a/features/general/basic.feature b/features/testbot/basic.feature similarity index 77% rename from features/general/basic.feature rename to features/testbot/basic.feature index 5ebe44c45..170e99049 100644 --- a/features/general/basic.feature +++ b/features/testbot/basic.feature @@ -1,6 +1,9 @@ @routing @basic Feature: Basic Routing + Background: + Given the speedprofile "testbot" + @smallest Scenario: A single way with two nodes Given the node map @@ -213,4 +216,41 @@ Feature: Basic Routing | a | d | abcd | | d | a | efgh | | a | m | aeim | - | m | a | aeim | \ No newline at end of file + | m | a | aeim | + + Scenario: Routing on a oneway roundabout + Given the node map + | | d | c | | + | e | | | b | + | f | | | a | + | | g | h | | + + And the ways + | nodes | oneway | + | ab | yes | + | bc | yes | + | cd | yes | + | de | yes | + | ef | yes | + | fg | yes | + | gh | yes | + | ha | yes | + + When I route I should get + | from | to | route | + | a | b | ab | + | b | c | bc | + | c | d | cd | + | d | e | de | + | e | f | ef | + | f | g | fg | + | g | h | gh | + | h | a | ha | + | b | a | bc,cd,de,ef,fg,gh,ha | + | c | b | cd,de,ef,fg,gh,ha,ab | + | d | c | de,ef,fg,gh,ha,ab,bc | + | e | d | ef,fg,gh,ha,ab,bc,cd | + | f | e | fg,gh,ha,ab,bc,cd,de | + | g | f | gh,ha,ab,bc,cd,de,ef | + | h | g | ha,ab,bc,cd,de,ef,fg | + | a | h | ab,bc,cd,de,ef,fg,gh | \ No newline at end of file diff --git a/features/general/bearing.feature b/features/testbot/bearing.feature similarity index 98% rename from features/general/bearing.feature rename to features/testbot/bearing.feature index f279c764b..69394390f 100644 --- a/features/general/bearing.feature +++ b/features/testbot/bearing.feature @@ -1,7 +1,9 @@ @routing @bearing Feature: Compass bearing - @northwest + Background: + Given the speedprofile "testbot" + Scenario: Bearing when going northwest Given the node map | b | | @@ -15,7 +17,6 @@ Feature: Compass bearing | from | to | route | compass | bearing | | a | b | ab | NW | 315 | - @west Scenario: Bearing when going west Given the node map | b | a | diff --git a/features/general/distance.feature b/features/testbot/distance.feature similarity index 99% rename from features/general/distance.feature rename to features/testbot/distance.feature index bff04dc87..e8dc0bda9 100644 --- a/features/general/distance.feature +++ b/features/testbot/distance.feature @@ -1,7 +1,9 @@ @routing @distance Feature: Distance calculation - @winding + Background: + Given the speedprofile "testbot" + Scenario: Distance should equal sum of segments, leftwinded Given the node map | e | | @@ -16,7 +18,6 @@ Feature: Distance calculation | from | to | route | distance | | a | d | abcde | 300 +-1 | - @winding Scenario: Distance should equal sum of segments, rightwinded Given the node map | | e | diff --git a/features/general/origin.feature b/features/testbot/origin.feature similarity index 95% rename from features/general/origin.feature rename to features/testbot/origin.feature index 4f1779079..c701196f5 100644 --- a/features/general/origin.feature +++ b/features/testbot/origin.feature @@ -1,6 +1,8 @@ @routing @origin Feature: Routing close to the [0,0] origin -Reference distances have been calculated usign http://seismo.cqu.edu.au/CQSRG/VDistance/ + + Background: + Given the speedprofile "testbot" Scenario: East-west oneways close to the origin Given the node locations diff --git a/features/general/penalty.feature b/features/testbot/penalty.feature similarity index 99% rename from features/general/penalty.feature rename to features/testbot/penalty.feature index 487005e79..da4fbf2a7 100644 --- a/features/general/penalty.feature +++ b/features/testbot/penalty.feature @@ -1,6 +1,6 @@ @routing @penalty @signal Feature: Penalties -Testbot uses a signal penalty of 7s +Testbot uses a signal penalty of 7s. Background: Given the speedprofile "testbot" diff --git a/features/general/planetary.feature b/features/testbot/planetary.feature similarity index 95% rename from features/general/planetary.feature rename to features/testbot/planetary.feature index adbcec433..f6c448270 100644 --- a/features/general/planetary.feature +++ b/features/testbot/planetary.feature @@ -1,6 +1,6 @@ @routing @planetary Feature: Distance calculation -#reference distances have been calculated usign http://seismo.cqu.edu.au/CQSRG/VDistance/ +Reference distances have been calculated usign http://seismo.cqu.edu.au/CQSRG/VDistance/ Scenario: Longitudinal distances at equator Given the node locations diff --git a/features/general/snap.feature b/features/testbot/snap.feature similarity index 98% rename from features/general/snap.feature rename to features/testbot/snap.feature index e42a85812..c359cc4bf 100644 --- a/features/general/snap.feature +++ b/features/testbot/snap.feature @@ -1,6 +1,9 @@ @routing @snap Feature: Snap start/end point to the nearest way + Background: + Given the speedprofile "testbot" + Scenario: Snap to nearest protruding oneway Given the node map | | 1 | | 2 | | diff --git a/features/general/time.feature b/features/testbot/time.feature similarity index 98% rename from features/general/time.feature rename to features/testbot/time.feature index fbc9c52b2..9157bba18 100644 --- a/features/general/time.feature +++ b/features/testbot/time.feature @@ -8,7 +8,6 @@ Tertiary road: 12km/h = 12000m/3600s = 100m/30s Background: Use specific speeds Given the speedprofile "testbot" - @basic_time Scenario: Basic travel time, 1m scale Given a grid size of 1 meters Given the node map @@ -38,7 +37,6 @@ Tertiary road: 12km/h = 12000m/3600s = 100m/30s | x | g | xg | 0s +-1 | | x | h | xh | 0s +-1 | - @basic_time Scenario: Basic travel time, 10m scale Given a grid size of 10 meters Given the node map @@ -68,7 +66,6 @@ Tertiary road: 12km/h = 12000m/3600s = 100m/30s | x | g | xg | 1s +-1 | | x | h | xh | 1s +-1 | - @basic_time Scenario: Basic travel time, 100m scale Given a grid size of 100 meters Given the node map @@ -98,7 +95,6 @@ Tertiary road: 12km/h = 12000m/3600s = 100m/30s | x | g | xg | 10s +-1 | | x | h | xh | 14s +-1 | - @basic_time Scenario: Basic travel time, 1km scale Given a grid size of 1000 meters Given the node map @@ -128,7 +124,6 @@ Tertiary road: 12km/h = 12000m/3600s = 100m/30s | x | g | xg | 100s +-1 | | x | h | xh | 141s +-1 | - @basic_time Scenario: Basic travel time, 10km scale Given a grid size of 10000 meters Given the node map diff --git a/features/general/utf.feature b/features/testbot/utf.feature similarity index 85% rename from features/general/utf.feature rename to features/testbot/utf.feature index f4f174d65..13d0c6fde 100644 --- a/features/general/utf.feature +++ b/features/testbot/utf.feature @@ -1,5 +1,8 @@ @routing @utf -Feature: Basic Routing +Feature: Handling of UTF characters + + Background: + Given the speedprofile "testbot" Scenario: Streetnames with UTF characters Given the node map diff --git a/features/general/weight.feature b/features/testbot/weight.feature similarity index 100% rename from features/general/weight.feature rename to features/testbot/weight.feature diff --git a/profiles/testbot.lua b/profiles/testbot.lua index a3bb7313b..f674ffe69 100644 --- a/profiles/testbot.lua +++ b/profiles/testbot.lua @@ -42,9 +42,21 @@ function way_function (way, numberOfNodesInWay) local highway = way.tags:Find("highway") local name = way.tags:Find("name") + local oneway = way.tags:Find("oneway") + way.name = name way.speed = speed_profile[highway] or speed_profile['default'] - way.direction = Way.bidirectional + + if oneway == "no" or oneway == "0" or oneway == "false" then + way.direction = Way.bidirectional + elseif oneway == "-1" then + way.direction = Way.opposite + elseif oneway == "yes" or oneway == "1" or oneway == "true" then + way.direction = Way.oneway + else + way.direction = Way.bidirectional + end + way.type = 1 return 1 end