osrm-backend/features/guidance/continue.feature

194 lines
6.1 KiB
Gherkin
Raw Normal View History

2016-03-23 08:04:23 -04:00
@routing @guidance
Feature: Continue Instructions
Background:
Given the profile "car"
Given a grid size of 10 meters
Scenario: Road turning left
Given the node map
2016-09-30 03:33:08 -04:00
"""
c
2016-10-19 13:08:48 -04:00
a - b-d
2016-09-30 03:33:08 -04:00
"""
2016-03-23 08:04:23 -04:00
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,continue left,arrive |
| a,d | abc,bd,bd | depart,turn straight,arrive |
2016-03-23 08:04:23 -04:00
Scenario: Road turning left, Suffix changes
Given the node map
"""
c
a - b-d
"""
And the ways
| nodes | highway | name |
| ab | primary | North Capitol Northeast |
| bc | primary | North Capitol Northwest |
| bd | primary | some random street |
When I route I should get
| waypoints | route | turns |
| a,c | North Capitol Northeast,North Capitol Northwest,North Capitol Northwest | depart,continue left,arrive |
Scenario: Road turning left, Suffix changes, no-spaces
Given the node map
"""
c
a - b-d
"""
And the ways
| nodes | highway | name |
| ab | primary | North CapitolNortheast |
| bc | primary | North CapitolNorthwest |
| bd | primary | some random street |
When I route I should get
| waypoints | route | turns |
| a,c | North CapitolNortheast,North CapitolNorthwest,North CapitolNorthwest | depart,continue left,arrive |
2016-05-23 09:51:31 -04:00
Scenario: Road turning left and straight
Given the node map
2016-09-30 03:33:08 -04:00
"""
c
2016-10-19 13:08:48 -04:00
a - b-d
2016-09-30 03:33:08 -04:00
"""
2016-05-23 09:51:31 -04:00
And the ways
| nodes | highway | name |
| abc | primary | road |
| bd | primary | road |
When I route I should get
| waypoints | route | turns |
| a,c | road,road,road | depart,continue left,arrive |
| a,d | road,road | depart,arrive |
Scenario: Road turning left and straight
Given the node map
2016-09-30 03:33:08 -04:00
"""
c
2016-10-19 13:08:48 -04:00
a - b-d
2016-09-30 03:33:08 -04:00
e
"""
2016-05-23 09:51:31 -04:00
And the ways
| nodes | highway | name |
| abc | primary | road |
| bd | primary | road |
| be | primary | road |
When I route I should get
| waypoints | route | turns |
| a,c | road,road,road | depart,continue left,arrive |
| a,d | road,road | depart,arrive |
| a,e | road,road,road | depart,continue right,arrive |
2016-03-23 08:04:23 -04:00
Scenario: Road turning right
Given the node map
2016-09-30 03:33:08 -04:00
"""
2016-10-19 13:08:48 -04:00
a - b-d
2016-09-30 03:33:08 -04:00
c
"""
2016-03-23 08:04:23 -04:00
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,continue right,arrive |
| a,d | abc,bd,bd | depart,turn straight,arrive |
2016-03-23 08:04:23 -04:00
Scenario: Road turning slight left
Given the node map
2016-09-30 03:33:08 -04:00
"""
c
2016-10-19 13:08:48 -04:00
/
a - b
`d
2016-09-30 03:33:08 -04:00
"""
2016-03-23 08:04:23 -04:00
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,continue left,arrive |
| a,d | abc,bd,bd | depart,turn right,arrive |
Scenario: Road turning slight right
Given the node map
2016-09-30 03:33:08 -04:00
"""
2016-10-19 13:08:48 -04:00
,d
a - b
\
2016-09-30 03:33:08 -04:00
c
"""
2016-03-23 08:04:23 -04:00
And the ways
| nodes | highway |
| abc | primary |
| bd | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abc,abc,abc | depart,continue right,arrive |
| a,d | abc,bd,bd | depart,turn left,arrive |
Scenario: Road Loop
Given the node map
2016-09-30 03:33:08 -04:00
"""
2016-10-19 13:08:48 -04:00
f - e
| |
a - b-g |
| |
c - d
2016-09-30 03:33:08 -04:00
"""
2016-03-23 08:04:23 -04:00
And the ways
| nodes | highway |
| abcdefb | primary |
| bg | primary |
When I route I should get
| waypoints | route | turns |
| a,c | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
| a,f | abcdefb,abcdefb,abcdefb | depart,continue left,arrive |
| a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
# continuing right here, since the turn to the left is more expensive
| a,e | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
Scenario: End-Of-Road Continue
Given the node map
"""
a - b - c
|
d - e
|
f
"""
And the ways
| nodes | highway | name |
| abc | primary | road |
| bdf | primary | road |
| ed | primary | turn |
When I route I should get
| waypoints | route | turns |
| e,a | turn,road,road,road | depart,turn right,continue left,arrive |