adding tests for guidance

This commit is contained in:
Moritz Kobitzsch
2016-03-23 13:04:23 +01:00
parent 56ba2cb251
commit fa0a5040e5
39 changed files with 2287 additions and 812 deletions
+2 -2
View File
@@ -36,5 +36,5 @@ Feature: Basic Routing
| fy | last |
When I route I should get
| from | to | route | turns |
| x | y | first,compr,last,last | depart,right,left,arrive |
| from | to | route |
| x | y | first,compr,last,last |
+9 -11
View File
@@ -1,10 +1,9 @@
@routing @testbot @overlap
@routing @testbot @overlap @todo
Feature: Testbot - overlapping ways
Background:
Given the profile "testbot"
@bug @610
Scenario: Testbot - multiple way between same nodes
Note that cb is connecting the same two nodes as bc
Given the node map
@@ -18,11 +17,10 @@ Feature: Testbot - overlapping ways
| cb | secondary |
When I route I should get
| from | to | route |
| a | d | ab,bc,cd |
| d | a | cd,bc,ab |
@bug @610
| from | to | route |
| a | d | ab,bc,cd,cd |
| d | a | cd,bc,ab,ab |
Scenario: Testbot - area on top of way
Given the node map
| x | a | b | y |
@@ -34,6 +32,6 @@ Feature: Testbot - overlapping ways
| abcda | secondary | yes |
When I route I should get
| from | to | route |
| x | y | xaby |
| y | x | xaby |
| from | to | route |
| x | y | xaby,xaby |
| y | x | xaby,xaby |
-76
View File
@@ -1,76 +0,0 @@
@routing @testbot @roundabout @instruction
Feature: Roundabout Instructions
Background:
Given the profile "testbot"
Scenario: Testbot - Roundabout
Given the node map
| | | v | | |
| | | d | | |
| s | a | | c | u |
| | | b | | |
| | | t | | |
And the ways
| nodes | junction |
| sa | |
| tb | |
| uc | |
| vd | |
| abcda | roundabout |
When I route I should get
| from | to | route | turns |
| s | t | sa,tb,tb | depart,roundabout-exit-1,arrive |
| s | u | sa,uc,uc | depart,roundabout-exit-2,arrive |
| s | v | sa,vd,vd | depart,roundabout-exit-3,arrive |
| t | u | tb,uc,uc | depart,roundabout-exit-1,arrive |
| t | v | tb,vd,vd | depart,roundabout-exit-2,arrive |
| t | s | tb,sa,sa | depart,roundabout-exit-3,arrive |
| u | v | uc,vd,vd | depart,roundabout-exit-1,arrive |
| u | s | uc,sa,sa | depart,roundabout-exit-2,arrive |
| u | t | uc,tb,tb | depart,roundabout-exit-3,arrive |
| v | s | vd,sa,sa | depart,roundabout-exit-1,arrive |
| v | t | vd,tb,tb | depart,roundabout-exit-2,arrive |
| v | u | vd,uc,uc | depart,roundabout-exit-3,arrive |
Scenario: Testbot - Roundabout with oneway links
Given the node map
| | | p | o | | |
| | | h | g | | |
| i | a | | | f | n |
| j | b | | | e | m |
| | | c | d | | |
| | | k | l | | |
And the ways
| nodes | junction | oneway |
| ai | | yes |
| jb | | yes |
| ck | | yes |
| ld | | yes |
| em | | yes |
| nf | | yes |
| go | | yes |
| ph | | yes |
| abcdefgha | roundabout | |
When I route I should get
| from | to | route | turns |
| j | k | jb,ck,ck | depart,roundabout-exit-1,arrive |
| j | m | jb,em,em | depart,roundabout-exit-2,arrive |
| j | o | jb,go,go | depart,roundabout-exit-3,arrive |
| j | i | jb,ai,ai | depart,roundabout-exit-4,arrive |
| l | m | ld,em,em | depart,roundabout-exit-1,arrive |
| l | o | ld,go,go | depart,roundabout-exit-2,arrive |
| l | i | ld,ai,ai | depart,roundabout-exit-3,arrive |
| l | k | ld,ck,ck | depart,roundabout-exit-4,arrive |
| n | o | nf,go,go | depart,roundabout-exit-1,arrive |
| n | i | nf,ai,ai | depart,roundabout-exit-2,arrive |
| n | k | nf,ck,ck | depart,roundabout-exit-3,arrive |
| n | m | nf,em,em | depart,roundabout-exit-4,arrive |
| p | i | ph,ai,ai | depart,roundabout-exit-1,arrive |
| p | k | ph,ck,ck | depart,roundabout-exit-2,arrive |
| p | m | ph,em,em | depart,roundabout-exit-3,arrive |
| p | o | ph,go,go | depart,roundabout-exit-4,arrive |
-74
View File
@@ -1,74 +0,0 @@
@routing @testbot @via
Feature: Via points
Background:
Given the profile "testbot"
And a grid size of 4 meters
Scenario: Basic Right Turn
Given the node map
| a | b | c | d | e | f | g |
| | | | | | h | |
| | | | | | i | |
| | | | | | j | |
| | | | | | k | |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk,ehijk | 34m +-1 | depart,right,arrive |
Scenario: Slight Turn
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | i | |
| | | | | | | | j |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk,ehijk | 35m +-1 | depart,slight right,arrive |
Scenario: Nearly Slight Turn
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | | |
| | | | | | | i | |
| | | | | | | | j |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk,ehijk | 37m +-1 | depart,right,arrive |
Scenario: Nearly Slight Turn (Variation)
Given the node map
| a | b | c | d | e | f | g | |
| | | | | | h | | |
| | | | | | | i | |
| | | | | | | j | |
| | | | | | | | k |
And the ways
| nodes | oneway |
| abcdefg | yes |
| ehijk | yes |
When I route I should get
| from | to | route | distance | turns |
| a | k | abcdefg,ehijk,ehijk | 37m +-1 | depart,right,arrive |
-115
View File
@@ -1,115 +0,0 @@
@routing @turns @testbot
Feature: Turn directions/codes
Background:
Given the profile "testbot"
Scenario: Turn directions
Given the node map
| o | p | a | b | c |
| n | | | | d |
| m | | x | | e |
| l | | | | f |
| k | j | i | h | g |
And the ways
| nodes |
| xi |
| xk |
| xm |
| xo |
| xa |
| xc |
| xe |
| xg |
When I route I should get
| from | to | route | turns |
| i | k | xi,xk,xk | depart,sharp left,arrive |
| i | m | xi,xm,xm | depart,left,arrive |
| i | o | xi,xo,xo | depart,slight left,arrive |
| i | a | xi,xa,xa | depart,straight,arrive |
| i | c | xi,xc,xc | depart,slight right,arrive |
| i | e | xi,xe,xe | depart,right,arrive |
| i | g | xi,xg,xg | depart,sharp right,arrive |
| k | m | xk,xm,xm | depart,sharp left,arrive |
| k | o | xk,xo,xo | depart,left,arrive |
| k | a | xk,xa,xa | depart,slight left,arrive |
| k | c | xk,xc,xc | depart,straight,arrive |
| k | e | xk,xe,xe | depart,slight right,arrive |
| k | g | xk,xg,xg | depart,right,arrive |
| k | i | xk,xi,xi | depart,sharp right,arrive |
| m | o | xm,xo,xo | depart,sharp left,arrive |
| m | a | xm,xa,xa | depart,left,arrive |
| m | c | xm,xc,xc | depart,slight left,arrive |
| m | e | xm,xe,xe | depart,straight,arrive |
| m | g | xm,xg,xg | depart,slight right,arrive |
| m | i | xm,xi,xi | depart,right,arrive |
| m | k | xm,xk,xk | depart,sharp right,arrive |
| o | a | xo,xa,xa | depart,sharp left,arrive |
| o | c | xo,xc,xc | depart,left,arrive |
| o | e | xo,xe,xe | depart,slight left,arrive |
| o | g | xo,xg,xg | depart,straight,arrive |
| o | i | xo,xi,xi | depart,slight right,arrive |
| o | k | xo,xk,xk | depart,right,arrive |
| o | m | xo,xm,xm | depart,sharp right,arrive |
| a | c | xa,xc,xc | depart,sharp left,arrive |
| a | e | xa,xe,xe | depart,left,arrive |
| a | g | xa,xg,xg | depart,slight left,arrive |
| a | i | xa,xi,xi | depart,straight,arrive |
| a | k | xa,xk,xk | depart,slight right,arrive |
| a | m | xa,xm,xm | depart,right,arrive |
| a | o | xa,xo,xo | depart,sharp right,arrive |
| c | e | xc,xe,xe | depart,sharp left,arrive |
| c | g | xc,xg,xg | depart,left,arrive |
| c | i | xc,xi,xi | depart,slight left,arrive |
| c | k | xc,xk,xk | depart,straight,arrive |
| c | m | xc,xm,xm | depart,slight right,arrive |
| c | o | xc,xo,xo | depart,right,arrive |
| c | a | xc,xa,xa | depart,sharp right,arrive |
| e | g | xe,xg,xg | depart,sharp left,arrive |
| e | i | xe,xi,xi | depart,left,arrive |
| e | k | xe,xk,xk | depart,slight left,arrive |
| e | m | xe,xm,xm | depart,straight,arrive |
| e | o | xe,xo,xo | depart,slight right,arrive |
| e | a | xe,xa,xa | depart,right,arrive |
| e | c | xe,xc,xc | depart,sharp right,arrive |
| g | i | xg,xi,xi | depart,sharp left,arrive |
| g | k | xg,xk,xk | depart,left,arrive |
| g | m | xg,xm,xm | depart,slight left,arrive |
| g | o | xg,xo,xo | depart,straight,arrive |
| g | a | xg,xa,xa | depart,slight right,arrive |
| g | c | xg,xc,xc | depart,right,arrive |
| g | e | xg,xe,xe | depart,sharp right,arrive |
Scenario: Turn instructions at high latitude
# https://github.com/DennisOSRM/Project-OSRM/issues/532
Given the node locations
| node | lat | lon |
| a | 55.68740 | 12.52430 |
| b | 55.68745 | 12.52409 |
| c | 55.68711 | 12.52383 |
| x | -55.68740 | 12.52430 |
| y | -55.68745 | 12.52409 |
| z | -55.68711 | 12.52383 |
And the ways
| nodes |
| ab |
| bc |
| xy |
| yz |
When I route I should get
| from | to | route | turns |
| a | c | ab,bc,bc | depart,left,arrive |
| c | a | bc,ab,ab | depart,right,arrive |
| x | z | xy,yz,yz | depart,right,arrive |
| z | x | yz,xy,xy | depart,left,arrive |
+4 -5
View File
@@ -20,8 +20,8 @@ Feature: U-turns at via points
| fg |
When I route I should get
| waypoints | route | turns |
| a,e,c | ab,be,be,ef,fg,dg,cd,cd | depart,right,arrive,depart,straight,left,left,arrive |
| waypoints | route |
| a,e,c | ab,be,be,ef,fg,dg,cd,cd |
Scenario: Query param to allow U-turns at all via points
Given the node map
@@ -45,7 +45,6 @@ Feature: U-turns at via points
| waypoints | route |
| a,e,c | ab,be,be,be,bc,bc |
@todo
Scenario: Instructions at via points at u-turns
Given the node map
| a | b | c | d |
@@ -65,8 +64,8 @@ Feature: U-turns at via points
| fg |
When I route I should get
| waypoints | route | turns |
| a,e,c | ab,be,be,bc,bc | depart,right,uturn,right,arrive |
| waypoints | route |
| a,e,c | ab,be,be,be,bc,bc |
Scenario: u-turn mixed with non-uturn vias
Given the node map