Adds the cucumber test framework referenced in issues #26, #95, #114

This commit is contained in:
Emil Tin
2012-02-14 17:21:07 +01:00
committed by DennisOSRM
parent 84b35f47a1
commit eeea5b0e81
28 changed files with 1818 additions and 1 deletions
+95
View File
@@ -0,0 +1,95 @@
@routing @restrictions
Feature: Turn restrictions
Handle turn restrictions as defined by http://wiki.openstreetmap.org/wiki/Relation:restriction
How this plays with u-turns can be tricky.
Scenario: No left turn
Given the nodes
| | t | |
| a | j | b |
| | s | |
And the ways
| nodes |
| bj |
| aj |
| sj |
| tj |
And the relations
| from | to | via | restriction |
| sj | aj | j | no_left_turn |
When I route I should get
| from | to | route |
| s | a | |
| s | b | sj,jb |
| s | t | sj,tj |
| a | b | aj,bj |
| a | a | aj,sj |
| a | t | aj,tj |
| b | b | jb,aj |
| b | s | bj,sj |
| b | t | bj,tj |
Scenario: No left turn, go counter-clockwise around the block instead
Given the nodes
| x | t | |
| a | j | b |
| | s | |
And the ways
| nodes |
| bj |
| aj |
| sj |
| tj |
| axt |
And the relations
| from | to | via | restriction |
| sj | aj | j | no_left_turn |
When I route I should get
| from | to | route |
| s | a | sj,tj,axt |
| s | b | sj,jb |
| s | t | sj,tj |
| a | b | aj,bj |
| a | a | aj,sj |
| a | t | aj,tj |
| b | b | jb,aj |
| b | s | bj,sj |
| b | t | bj,tj |
Scenario: No left turn, go clockwise around the block instead
Given the nodes
| | | t | |
| z | a | j | b |
| x | | s | |
And the ways
| nodes |
| bj |
| aj |
| sj |
| tj |
| sxza |
And the relations
| from | to | via | restriction |
| sj | aj | j | no_left_turn |
When I route I should get
| from | to | route |
| s | a | sxza |
| s | b | sj,jb |
| s | t | sj,tj |
| a | b | aj,bj |
| a | a | aj,sj |
| a | t | aj,tj |
| b | b | jb,aj |
| b | s | bj,sj |
| b | t | bj,tj |