Skip to content

Commit

Permalink
adding tests to highlight via-way-restriciton development
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Kobitzsch committed Jul 7, 2017
1 parent d52d530 commit 71a34a3
Showing 1 changed file with 132 additions and 0 deletions.
132 changes: 132 additions & 0 deletions features/car/restrictions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -506,3 +506,135 @@ Feature: Car - Turn restrictions
| s | n | sj,nj,nj |
| s | e | sj,ej,ej |

@restriction
Scenario: Car - prohibit turn
Given the node map
"""
c
|
| f
| |
b---e
| |
a d
"""

And the ways
| nodes |
| ab |
| bc |
| be |
| de |
| ef |

And the relations
| type | way:from | way:via | way:from | restriction |
| restriction | ab | be | de | no_right_turn |

When I route I should get
| from | to | route |
| a | d | ab,be,de,de |

@restriction
Scenario: Car - allow only turn
Given the node map
"""
c
|
| f
| |
b---e
| |
a d
"""

And the ways
| nodes |
| ab |
| bc |
| be |
| de |
| ef |

And the relations
| type | way:from | way:via | way:from | restriction |
| restriction | ab | be | ef | only_left_on |

When I route I should get
| from | to | route |
| a | d | ab,be,de,de |

@restriction
Scenario: Multi Way restriction
Given the node map
"""
k j
| |
h - - g - f - - e
| |
| |
a - - b - c - - d
| |
l i
"""

And the ways
| nodes | name | oneway |
| ab | horiz | yes |
| bc | horiz | yes |
| cd | horiz | yes |
| ef | horiz | yes |
| fg | horiz | yes |
| gh | horiz | yes |
| ic | vert | yes |
| cf | vert | yes |
| fj | vert | yes |
| kg | vert | yes |
| gb | vert | yes |
| bl | vert | yes |

And the relations
| type | way:from | way:via | way:to | restriction |
| restriction | ab | bc,cf,fg | gh | no_u_turn |

When I route I should get
| from | to | route |
| a | h | horiz,vert,horiz,horiz |

@restriction
Scenario: Multi-Way overlapping single-way
Given the node map
"""
e
|
a - b - c - d
|
f - g
|
h
"""

And the ways
| nodes | name |
| ab | abcd |
| bc | abcd |
| cd | abcd |
| hf | hfb |
| fb | hfb |
| gf | gf |
| ce | ce |

And the relations
| type | way:from | way:via | way:to | restriction |
| restriction | ab | bc | ce | only_left_turn |
| restriction | gf | fb,bc | cd | only_u_turn |

When I route I should get
| from | to | route |
| a | d | abcd,abcd |
| a | e | abcd,ce,ce |
| a | f | abcd,hfb,hfb |
| g | e | gf,hfb,abcd,ce,ce |
| g | d | gf,hfb,abcd,abcd |
| h | e | hfb,abcd,ce,ce |
| h | d | hfb,abcd,abcd |

0 comments on commit 71a34a3

Please sign in to comment.