From fac5e0ffb8159875cf1e316069adbf9f2f84ffa9 Mon Sep 17 00:00:00 2001 From: Freenerd Date: Wed, 21 Sep 2016 12:33:23 +0200 Subject: [PATCH] Support destinations - Adds way_name to off ramp and on ramp --- .eslintrc.json | 2 +- index.js | 11 +++++-- instructions.json | 30 +++++++++++-------- .../v5/continue/straight_destinations.json | 11 +++++++ test/fixtures/v5/end_of_road/right.json | 2 +- .../v5/end_of_road/right_destinations.json | 11 +++++++ test/fixtures/v5/fork/right_destinations.json | 11 +++++++ .../fixtures/v5/merge/right_destinations.json | 11 +++++++ .../v5/new_name/right_destinations.json | 11 +++++++ test/fixtures/v5/off_ramp/left.json | 4 +-- .../v5/off_ramp/left_destinations.json | 11 +++++++ test/fixtures/v5/off_ramp/left_no_name.json | 10 +++++++ test/fixtures/v5/off_ramp/right.json | 4 +-- .../v5/off_ramp/right_destinations.json | 11 +++++++ test/fixtures/v5/off_ramp/right_no_name.json | 10 +++++++ test/fixtures/v5/off_ramp/sharp_left.json | 4 +-- .../v5/off_ramp/sharp_left_destinations.json | 11 +++++++ .../v5/off_ramp/sharp_left_no_name.json | 10 +++++++ test/fixtures/v5/off_ramp/sharp_right.json | 4 +-- .../v5/off_ramp/sharp_right_destinations.json | 11 +++++++ .../v5/off_ramp/sharp_right_no_name.json | 10 +++++++ test/fixtures/v5/off_ramp/slight_left.json | 4 +-- .../v5/off_ramp/slight_left_destinations.json | 11 +++++++ .../v5/off_ramp/slight_left_no_name.json | 10 +++++++ test/fixtures/v5/off_ramp/slight_right.json | 4 +-- .../off_ramp/slight_right_destinations.json | 11 +++++++ .../v5/off_ramp/slight_right_no_name.json | 10 +++++++ test/fixtures/v5/off_ramp/straight.json | 4 +-- .../v5/off_ramp/straight_destinations.json | 11 +++++++ .../v5/off_ramp/straight_no_name.json | 11 +++++++ test/fixtures/v5/off_ramp/uturn.json | 4 +-- .../v5/off_ramp/uturn_destinations.json | 11 +++++++ test/fixtures/v5/off_ramp/uturn_no_name.json | 10 +++++++ test/fixtures/v5/on_ramp/left.json | 4 +-- .../v5/on_ramp/left_destinations.json | 11 +++++++ test/fixtures/v5/on_ramp/left_no_name.json | 10 +++++++ test/fixtures/v5/on_ramp/right.json | 4 +-- .../v5/on_ramp/right_destinations.json | 11 +++++++ test/fixtures/v5/on_ramp/right_no_name.json | 10 +++++++ test/fixtures/v5/on_ramp/sharp_left.json | 4 +-- .../v5/on_ramp/sharp_left_destinations.json | 11 +++++++ .../v5/on_ramp/sharp_left_no_name.json | 10 +++++++ test/fixtures/v5/on_ramp/sharp_right.json | 4 +-- .../v5/on_ramp/sharp_right_destinations.json | 11 +++++++ .../v5/on_ramp/sharp_right_no_name.json | 10 +++++++ test/fixtures/v5/on_ramp/slight_left.json | 4 +-- .../v5/on_ramp/slight_left_destinations.json | 11 +++++++ .../v5/on_ramp/slight_left_no_name.json | 10 +++++++ test/fixtures/v5/on_ramp/slight_right.json | 4 +-- .../v5/on_ramp/slight_right_destinations.json | 11 +++++++ .../v5/on_ramp/slight_right_no_name.json | 10 +++++++ test/fixtures/v5/on_ramp/straight.json | 4 +-- .../v5/on_ramp/straight_destinations.json | 11 +++++++ .../fixtures/v5/on_ramp/straight_no_name.json | 10 +++++++ test/fixtures/v5/on_ramp/uturn.json | 4 +-- .../v5/on_ramp/uturn_destinations.json | 11 +++++++ test/fixtures/v5/on_ramp/uturn_no_name.json | 10 +++++++ .../v5/roundabout_turn/left_destinations.json | 11 +++++++ .../roundabout_turn/right_destinations.json | 11 +++++++ .../sharp_left_destinations.json | 11 +++++++ .../sharp_right_destinations.json | 11 +++++++ .../slight_left_destinations.json | 11 +++++++ .../slight_right_destinations.json | 11 +++++++ .../straight_destinations.json | 11 +++++++ .../v5/roundabout_turn/straight_no_name.json | 6 ++-- .../v5/roundabout_turn/turn_right.json | 11 ------- .../roundabout_turn/uturn_destinations.json | 11 +++++++ test/fixtures/v5/use_lane/oox.json | 25 ++++++++++++++++ .../v5/use_lane/oox_destinations.json | 26 ++++++++++++++++ 69 files changed, 594 insertions(+), 63 deletions(-) create mode 100644 test/fixtures/v5/continue/straight_destinations.json create mode 100644 test/fixtures/v5/end_of_road/right_destinations.json create mode 100644 test/fixtures/v5/fork/right_destinations.json create mode 100644 test/fixtures/v5/merge/right_destinations.json create mode 100644 test/fixtures/v5/new_name/right_destinations.json create mode 100644 test/fixtures/v5/off_ramp/left_destinations.json create mode 100644 test/fixtures/v5/off_ramp/left_no_name.json create mode 100644 test/fixtures/v5/off_ramp/right_destinations.json create mode 100644 test/fixtures/v5/off_ramp/right_no_name.json create mode 100644 test/fixtures/v5/off_ramp/sharp_left_destinations.json create mode 100644 test/fixtures/v5/off_ramp/sharp_left_no_name.json create mode 100644 test/fixtures/v5/off_ramp/sharp_right_destinations.json create mode 100644 test/fixtures/v5/off_ramp/sharp_right_no_name.json create mode 100644 test/fixtures/v5/off_ramp/slight_left_destinations.json create mode 100644 test/fixtures/v5/off_ramp/slight_left_no_name.json create mode 100644 test/fixtures/v5/off_ramp/slight_right_destinations.json create mode 100644 test/fixtures/v5/off_ramp/slight_right_no_name.json create mode 100644 test/fixtures/v5/off_ramp/straight_destinations.json create mode 100644 test/fixtures/v5/off_ramp/straight_no_name.json create mode 100644 test/fixtures/v5/off_ramp/uturn_destinations.json create mode 100644 test/fixtures/v5/off_ramp/uturn_no_name.json create mode 100644 test/fixtures/v5/on_ramp/left_destinations.json create mode 100644 test/fixtures/v5/on_ramp/left_no_name.json create mode 100644 test/fixtures/v5/on_ramp/right_destinations.json create mode 100644 test/fixtures/v5/on_ramp/right_no_name.json create mode 100644 test/fixtures/v5/on_ramp/sharp_left_destinations.json create mode 100644 test/fixtures/v5/on_ramp/sharp_left_no_name.json create mode 100644 test/fixtures/v5/on_ramp/sharp_right_destinations.json create mode 100644 test/fixtures/v5/on_ramp/sharp_right_no_name.json create mode 100644 test/fixtures/v5/on_ramp/slight_left_destinations.json create mode 100644 test/fixtures/v5/on_ramp/slight_left_no_name.json create mode 100644 test/fixtures/v5/on_ramp/slight_right_destinations.json create mode 100644 test/fixtures/v5/on_ramp/slight_right_no_name.json create mode 100644 test/fixtures/v5/on_ramp/straight_destinations.json create mode 100644 test/fixtures/v5/on_ramp/straight_no_name.json create mode 100644 test/fixtures/v5/on_ramp/uturn_destinations.json create mode 100644 test/fixtures/v5/on_ramp/uturn_no_name.json create mode 100644 test/fixtures/v5/roundabout_turn/left_destinations.json create mode 100644 test/fixtures/v5/roundabout_turn/right_destinations.json create mode 100644 test/fixtures/v5/roundabout_turn/sharp_left_destinations.json create mode 100644 test/fixtures/v5/roundabout_turn/sharp_right_destinations.json create mode 100644 test/fixtures/v5/roundabout_turn/slight_left_destinations.json create mode 100644 test/fixtures/v5/roundabout_turn/slight_right_destinations.json create mode 100644 test/fixtures/v5/roundabout_turn/straight_destinations.json delete mode 100644 test/fixtures/v5/roundabout_turn/turn_right.json create mode 100644 test/fixtures/v5/roundabout_turn/uturn_destinations.json create mode 100644 test/fixtures/v5/use_lane/oox.json create mode 100644 test/fixtures/v5/use_lane/oox_destinations.json diff --git a/.eslintrc.json b/.eslintrc.json index 6b1f46011..216f3b427 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -35,7 +35,7 @@ } ], "comma-style": "error", - "complexity": "error", + "complexity": "off", "computed-property-spacing": [ "error", "never" diff --git a/index.js b/index.js index 5e83222e3..e564d2c89 100644 --- a/index.js +++ b/index.js @@ -74,8 +74,15 @@ module.exports = function(_version) { break; } - // Handle instructions with names - if (step.name && step.name !== '') { + // Handle instructions with destinations and names + if (step.destinations && step.destinations !== '') { + // only use the first destination for text instruction + var d = step.destinations.split(',')[0]; + var t = instructions[version].templates.destination; + + instruction = instruction + .replace(/\[.+\]/, t.replace('{destination}', d)); + } else if (step.name && step.name !== '') { instruction = instruction .replace('[', '') .replace(']', '') diff --git a/instructions.json b/instructions.json index 7817ad3a4..69c1a6d9c 100644 --- a/instructions.json +++ b/instructions.json @@ -1,5 +1,8 @@ { "v5": { + "templates": { + "destination": " towards {destination}" + }, "arrive": { "defaultInstruction": "You have arrived at your {nth} destination", "left": "You have arrived at your {nth} destination, on the left", @@ -53,21 +56,22 @@ "defaultInstruction": "Continue {modifier}[ onto {way_name}]" }, "off ramp": { - "defaultInstruction": "Take the ramp", - "left": "Take the ramp on the left", - "right": "Take the ramp on the right", - "slight left": "Take the ramp on the left", - "slight right": "Take the ramp on the right" + "defaultInstruction": "Take the ramp[ onto {way_name}]", + "left": "Take the ramp on the left[ onto {way_name}]", + "right": "Take the ramp on the right[ onto {way_name}]", + "sharp left": "Take the ramp on the left[ onto {way_name}]", + "sharp right": "Take the ramp on the right[ onto {way_name}]", + "slight left": "Take the ramp on the left[ onto {way_name}]", + "slight right": "Take the ramp on the right[ onto {way_name}]" }, "on ramp": { - "defaultInstruction": "Take the ramp on the {modifier}", - "left": "Take the ramp on the left", - "right": "Take the ramp on the right", - "sharp left": "Take the ramp on the left", - "sharp right": "Take the ramp on the right", - "slight left": "Take the ramp on the left", - "slight right": "Take the ramp on the right", - "straight": "Take the ramp" + "defaultInstruction": "Take the ramp[ onto {way_name}]", + "left": "Take the ramp on the left[ onto {way_name}]", + "right": "Take the ramp on the right[ onto {way_name}]", + "sharp left": "Take the ramp on the left[ onto {way_name}]", + "sharp right": "Take the ramp on the right[ onto {way_name}]", + "slight left": "Take the ramp on the left[ onto {way_name}]", + "slight right": "Take the ramp on the right[ onto {way_name}]" }, "pushing bike": { "defaultInstruction": "Get off the bike and push[ onto {way_name}]" diff --git a/test/fixtures/v5/continue/straight_destinations.json b/test/fixtures/v5/continue/straight_destinations.json new file mode 100644 index 000000000..044ce1dfd --- /dev/null +++ b/test/fixtures/v5/continue/straight_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "straight", + "type": "continue" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Continue straight towards City 1" +} diff --git a/test/fixtures/v5/end_of_road/right.json b/test/fixtures/v5/end_of_road/right.json index 727520fa8..6bed6c80c 100644 --- a/test/fixtures/v5/end_of_road/right.json +++ b/test/fixtures/v5/end_of_road/right.json @@ -7,4 +7,4 @@ "name": "Street Name" }, "instruction": "Turn right onto Street Name at the end of the road" -} \ No newline at end of file +} diff --git a/test/fixtures/v5/end_of_road/right_destinations.json b/test/fixtures/v5/end_of_road/right_destinations.json new file mode 100644 index 000000000..a7fc66db0 --- /dev/null +++ b/test/fixtures/v5/end_of_road/right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "end of road" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Turn right towards City 1 at the end of the road" +} diff --git a/test/fixtures/v5/fork/right_destinations.json b/test/fixtures/v5/fork/right_destinations.json new file mode 100644 index 000000000..2d73c499a --- /dev/null +++ b/test/fixtures/v5/fork/right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "fork" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Keep right at the fork towards City 1" +} diff --git a/test/fixtures/v5/merge/right_destinations.json b/test/fixtures/v5/merge/right_destinations.json new file mode 100644 index 000000000..d53f12176 --- /dev/null +++ b/test/fixtures/v5/merge/right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "merge" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Merge right towards City 1" +} diff --git a/test/fixtures/v5/new_name/right_destinations.json b/test/fixtures/v5/new_name/right_destinations.json new file mode 100644 index 000000000..a7b4c5d4a --- /dev/null +++ b/test/fixtures/v5/new_name/right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "new name" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Continue right towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/left.json b/test/fixtures/v5/off_ramp/left.json index ab2da5bf8..5036e943c 100644 --- a/test/fixtures/v5/off_ramp/left.json +++ b/test/fixtures/v5/off_ramp/left.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the left" -} \ No newline at end of file + "instruction": "Take the ramp on the left onto Street Name" +} diff --git a/test/fixtures/v5/off_ramp/left_destinations.json b/test/fixtures/v5/off_ramp/left_destinations.json new file mode 100644 index 000000000..03f9cefa5 --- /dev/null +++ b/test/fixtures/v5/off_ramp/left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "left", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the left towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/left_no_name.json b/test/fixtures/v5/off_ramp/left_no_name.json new file mode 100644 index 000000000..9f107b72d --- /dev/null +++ b/test/fixtures/v5/off_ramp/left_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "left", + "type": "off ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the left" +} diff --git a/test/fixtures/v5/off_ramp/right.json b/test/fixtures/v5/off_ramp/right.json index bea7cf87d..caad24265 100644 --- a/test/fixtures/v5/off_ramp/right.json +++ b/test/fixtures/v5/off_ramp/right.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the right" -} \ No newline at end of file + "instruction": "Take the ramp on the right onto Street Name" +} diff --git a/test/fixtures/v5/off_ramp/right_destinations.json b/test/fixtures/v5/off_ramp/right_destinations.json new file mode 100644 index 000000000..ddb5ba316 --- /dev/null +++ b/test/fixtures/v5/off_ramp/right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the right towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/right_no_name.json b/test/fixtures/v5/off_ramp/right_no_name.json new file mode 100644 index 000000000..6b52b42f2 --- /dev/null +++ b/test/fixtures/v5/off_ramp/right_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "off ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the right" +} diff --git a/test/fixtures/v5/off_ramp/sharp_left.json b/test/fixtures/v5/off_ramp/sharp_left.json index 11c481175..82ba7d69e 100644 --- a/test/fixtures/v5/off_ramp/sharp_left.json +++ b/test/fixtures/v5/off_ramp/sharp_left.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp" -} \ No newline at end of file + "instruction": "Take the ramp on the left onto Street Name" +} diff --git a/test/fixtures/v5/off_ramp/sharp_left_destinations.json b/test/fixtures/v5/off_ramp/sharp_left_destinations.json new file mode 100644 index 000000000..39d492142 --- /dev/null +++ b/test/fixtures/v5/off_ramp/sharp_left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp left", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the left towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/sharp_left_no_name.json b/test/fixtures/v5/off_ramp/sharp_left_no_name.json new file mode 100644 index 000000000..1595e89c8 --- /dev/null +++ b/test/fixtures/v5/off_ramp/sharp_left_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp left", + "type": "off ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the left" +} diff --git a/test/fixtures/v5/off_ramp/sharp_right.json b/test/fixtures/v5/off_ramp/sharp_right.json index 54cdc523f..cf1cec142 100644 --- a/test/fixtures/v5/off_ramp/sharp_right.json +++ b/test/fixtures/v5/off_ramp/sharp_right.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp" -} \ No newline at end of file + "instruction": "Take the ramp on the right onto Street Name" +} diff --git a/test/fixtures/v5/off_ramp/sharp_right_destinations.json b/test/fixtures/v5/off_ramp/sharp_right_destinations.json new file mode 100644 index 000000000..34cf6c734 --- /dev/null +++ b/test/fixtures/v5/off_ramp/sharp_right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp right", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the right towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/sharp_right_no_name.json b/test/fixtures/v5/off_ramp/sharp_right_no_name.json new file mode 100644 index 000000000..1c4278513 --- /dev/null +++ b/test/fixtures/v5/off_ramp/sharp_right_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp right", + "type": "off ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the right" +} diff --git a/test/fixtures/v5/off_ramp/slight_left.json b/test/fixtures/v5/off_ramp/slight_left.json index 5b9fe3724..8bd3ee464 100644 --- a/test/fixtures/v5/off_ramp/slight_left.json +++ b/test/fixtures/v5/off_ramp/slight_left.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the left" -} \ No newline at end of file + "instruction": "Take the ramp on the left onto Street Name" +} diff --git a/test/fixtures/v5/off_ramp/slight_left_destinations.json b/test/fixtures/v5/off_ramp/slight_left_destinations.json new file mode 100644 index 000000000..ee5641bd5 --- /dev/null +++ b/test/fixtures/v5/off_ramp/slight_left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "slight left", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the left towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/slight_left_no_name.json b/test/fixtures/v5/off_ramp/slight_left_no_name.json new file mode 100644 index 000000000..e87918829 --- /dev/null +++ b/test/fixtures/v5/off_ramp/slight_left_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "slight left", + "type": "off ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the left" +} diff --git a/test/fixtures/v5/off_ramp/slight_right.json b/test/fixtures/v5/off_ramp/slight_right.json index 93a6462b9..243bb429b 100644 --- a/test/fixtures/v5/off_ramp/slight_right.json +++ b/test/fixtures/v5/off_ramp/slight_right.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the right" -} \ No newline at end of file + "instruction": "Take the ramp on the right onto Street Name" +} diff --git a/test/fixtures/v5/off_ramp/slight_right_destinations.json b/test/fixtures/v5/off_ramp/slight_right_destinations.json new file mode 100644 index 000000000..dd038b004 --- /dev/null +++ b/test/fixtures/v5/off_ramp/slight_right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "slight right", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the right towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/slight_right_no_name.json b/test/fixtures/v5/off_ramp/slight_right_no_name.json new file mode 100644 index 000000000..b822bb663 --- /dev/null +++ b/test/fixtures/v5/off_ramp/slight_right_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "slight right", + "type": "off ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the right" +} diff --git a/test/fixtures/v5/off_ramp/straight.json b/test/fixtures/v5/off_ramp/straight.json index 50b399ee5..6aacf6a80 100644 --- a/test/fixtures/v5/off_ramp/straight.json +++ b/test/fixtures/v5/off_ramp/straight.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp" -} \ No newline at end of file + "instruction": "Take the ramp onto Street Name" +} diff --git a/test/fixtures/v5/off_ramp/straight_destinations.json b/test/fixtures/v5/off_ramp/straight_destinations.json new file mode 100644 index 000000000..6a62cdef8 --- /dev/null +++ b/test/fixtures/v5/off_ramp/straight_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "straight", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/straight_no_name.json b/test/fixtures/v5/off_ramp/straight_no_name.json new file mode 100644 index 000000000..6a62cdef8 --- /dev/null +++ b/test/fixtures/v5/off_ramp/straight_no_name.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "straight", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/uturn.json b/test/fixtures/v5/off_ramp/uturn.json index 61948d007..8a99f3532 100644 --- a/test/fixtures/v5/off_ramp/uturn.json +++ b/test/fixtures/v5/off_ramp/uturn.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp" -} \ No newline at end of file + "instruction": "Take the ramp onto Street Name" +} diff --git a/test/fixtures/v5/off_ramp/uturn_destinations.json b/test/fixtures/v5/off_ramp/uturn_destinations.json new file mode 100644 index 000000000..07d24f58b --- /dev/null +++ b/test/fixtures/v5/off_ramp/uturn_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "uturn", + "type": "off ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp towards City 1" +} diff --git a/test/fixtures/v5/off_ramp/uturn_no_name.json b/test/fixtures/v5/off_ramp/uturn_no_name.json new file mode 100644 index 000000000..190bcbf50 --- /dev/null +++ b/test/fixtures/v5/off_ramp/uturn_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "uturn", + "type": "off ramp" + }, + "name": "" + }, + "instruction": "Take the ramp" +} diff --git a/test/fixtures/v5/on_ramp/left.json b/test/fixtures/v5/on_ramp/left.json index 6dfef1c4d..80c428964 100644 --- a/test/fixtures/v5/on_ramp/left.json +++ b/test/fixtures/v5/on_ramp/left.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the left" -} \ No newline at end of file + "instruction": "Take the ramp on the left onto Street Name" +} diff --git a/test/fixtures/v5/on_ramp/left_destinations.json b/test/fixtures/v5/on_ramp/left_destinations.json new file mode 100644 index 000000000..98f18dff0 --- /dev/null +++ b/test/fixtures/v5/on_ramp/left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "left", + "type": "on ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the left towards City 1" +} diff --git a/test/fixtures/v5/on_ramp/left_no_name.json b/test/fixtures/v5/on_ramp/left_no_name.json new file mode 100644 index 000000000..c4c414d13 --- /dev/null +++ b/test/fixtures/v5/on_ramp/left_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "left", + "type": "on ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the left" +} diff --git a/test/fixtures/v5/on_ramp/right.json b/test/fixtures/v5/on_ramp/right.json index 1f14e8f68..0632cb767 100644 --- a/test/fixtures/v5/on_ramp/right.json +++ b/test/fixtures/v5/on_ramp/right.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the right" -} \ No newline at end of file + "instruction": "Take the ramp on the right onto Street Name" +} diff --git a/test/fixtures/v5/on_ramp/right_destinations.json b/test/fixtures/v5/on_ramp/right_destinations.json new file mode 100644 index 000000000..6524292fb --- /dev/null +++ b/test/fixtures/v5/on_ramp/right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "on ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the right towards City 1" +} diff --git a/test/fixtures/v5/on_ramp/right_no_name.json b/test/fixtures/v5/on_ramp/right_no_name.json new file mode 100644 index 000000000..960d6c0f4 --- /dev/null +++ b/test/fixtures/v5/on_ramp/right_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "on ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the right" +} diff --git a/test/fixtures/v5/on_ramp/sharp_left.json b/test/fixtures/v5/on_ramp/sharp_left.json index dce75011a..a686eccc6 100644 --- a/test/fixtures/v5/on_ramp/sharp_left.json +++ b/test/fixtures/v5/on_ramp/sharp_left.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the left" -} \ No newline at end of file + "instruction": "Take the ramp on the left onto Street Name" +} diff --git a/test/fixtures/v5/on_ramp/sharp_left_destinations.json b/test/fixtures/v5/on_ramp/sharp_left_destinations.json new file mode 100644 index 000000000..44c1f8dff --- /dev/null +++ b/test/fixtures/v5/on_ramp/sharp_left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp left", + "type": "on ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the left towards City 1" +} diff --git a/test/fixtures/v5/on_ramp/sharp_left_no_name.json b/test/fixtures/v5/on_ramp/sharp_left_no_name.json new file mode 100644 index 000000000..3ff0b8a9b --- /dev/null +++ b/test/fixtures/v5/on_ramp/sharp_left_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp left", + "type": "on ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the left" +} diff --git a/test/fixtures/v5/on_ramp/sharp_right.json b/test/fixtures/v5/on_ramp/sharp_right.json index 4161360d2..540de7fdb 100644 --- a/test/fixtures/v5/on_ramp/sharp_right.json +++ b/test/fixtures/v5/on_ramp/sharp_right.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the right" -} \ No newline at end of file + "instruction": "Take the ramp on the right onto Street Name" +} diff --git a/test/fixtures/v5/on_ramp/sharp_right_destinations.json b/test/fixtures/v5/on_ramp/sharp_right_destinations.json new file mode 100644 index 000000000..bdc5813fa --- /dev/null +++ b/test/fixtures/v5/on_ramp/sharp_right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp right", + "type": "on ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the right towards City 1" +} diff --git a/test/fixtures/v5/on_ramp/sharp_right_no_name.json b/test/fixtures/v5/on_ramp/sharp_right_no_name.json new file mode 100644 index 000000000..229e954ad --- /dev/null +++ b/test/fixtures/v5/on_ramp/sharp_right_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp right", + "type": "on ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the right" +} diff --git a/test/fixtures/v5/on_ramp/slight_left.json b/test/fixtures/v5/on_ramp/slight_left.json index 89a6582a5..38641d5ca 100644 --- a/test/fixtures/v5/on_ramp/slight_left.json +++ b/test/fixtures/v5/on_ramp/slight_left.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the left" -} \ No newline at end of file + "instruction": "Take the ramp on the left onto Street Name" +} diff --git a/test/fixtures/v5/on_ramp/slight_left_destinations.json b/test/fixtures/v5/on_ramp/slight_left_destinations.json new file mode 100644 index 000000000..1962a525a --- /dev/null +++ b/test/fixtures/v5/on_ramp/slight_left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "slight left", + "type": "on ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the left towards City 1" +} diff --git a/test/fixtures/v5/on_ramp/slight_left_no_name.json b/test/fixtures/v5/on_ramp/slight_left_no_name.json new file mode 100644 index 000000000..3b07dfcbe --- /dev/null +++ b/test/fixtures/v5/on_ramp/slight_left_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "slight left", + "type": "on ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the left" +} diff --git a/test/fixtures/v5/on_ramp/slight_right.json b/test/fixtures/v5/on_ramp/slight_right.json index 58c82951a..f15ab3235 100644 --- a/test/fixtures/v5/on_ramp/slight_right.json +++ b/test/fixtures/v5/on_ramp/slight_right.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the right" -} \ No newline at end of file + "instruction": "Take the ramp on the right onto Street Name" +} diff --git a/test/fixtures/v5/on_ramp/slight_right_destinations.json b/test/fixtures/v5/on_ramp/slight_right_destinations.json new file mode 100644 index 000000000..f31a19aa6 --- /dev/null +++ b/test/fixtures/v5/on_ramp/slight_right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "slight right", + "type": "on ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp on the right towards City 1" +} diff --git a/test/fixtures/v5/on_ramp/slight_right_no_name.json b/test/fixtures/v5/on_ramp/slight_right_no_name.json new file mode 100644 index 000000000..c327a1781 --- /dev/null +++ b/test/fixtures/v5/on_ramp/slight_right_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "slight right", + "type": "on ramp" + }, + "name": "" + }, + "instruction": "Take the ramp on the right" +} diff --git a/test/fixtures/v5/on_ramp/straight.json b/test/fixtures/v5/on_ramp/straight.json index 27fd91492..af6e64693 100644 --- a/test/fixtures/v5/on_ramp/straight.json +++ b/test/fixtures/v5/on_ramp/straight.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp" -} \ No newline at end of file + "instruction": "Take the ramp onto Street Name" +} diff --git a/test/fixtures/v5/on_ramp/straight_destinations.json b/test/fixtures/v5/on_ramp/straight_destinations.json new file mode 100644 index 000000000..3a7384acf --- /dev/null +++ b/test/fixtures/v5/on_ramp/straight_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "straight", + "type": "on ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp towards City 1" +} diff --git a/test/fixtures/v5/on_ramp/straight_no_name.json b/test/fixtures/v5/on_ramp/straight_no_name.json new file mode 100644 index 000000000..5be0b6c8e --- /dev/null +++ b/test/fixtures/v5/on_ramp/straight_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "straight", + "type": "on ramp" + }, + "name": "" + }, + "instruction": "Take the ramp" +} diff --git a/test/fixtures/v5/on_ramp/uturn.json b/test/fixtures/v5/on_ramp/uturn.json index 2db0fba5c..781a61d0a 100644 --- a/test/fixtures/v5/on_ramp/uturn.json +++ b/test/fixtures/v5/on_ramp/uturn.json @@ -6,5 +6,5 @@ }, "name": "Street Name" }, - "instruction": "Take the ramp on the uturn" -} \ No newline at end of file + "instruction": "Take the ramp onto Street Name" +} diff --git a/test/fixtures/v5/on_ramp/uturn_destinations.json b/test/fixtures/v5/on_ramp/uturn_destinations.json new file mode 100644 index 000000000..2974a44ad --- /dev/null +++ b/test/fixtures/v5/on_ramp/uturn_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "uturn", + "type": "on ramp" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "Take the ramp towards City 1" +} diff --git a/test/fixtures/v5/on_ramp/uturn_no_name.json b/test/fixtures/v5/on_ramp/uturn_no_name.json new file mode 100644 index 000000000..d13e081f1 --- /dev/null +++ b/test/fixtures/v5/on_ramp/uturn_no_name.json @@ -0,0 +1,10 @@ +{ + "step": { + "maneuver": { + "modifier": "uturn", + "type": "on ramp" + }, + "name": "" + }, + "instruction": "Take the ramp" +} diff --git a/test/fixtures/v5/roundabout_turn/left_destinations.json b/test/fixtures/v5/roundabout_turn/left_destinations.json new file mode 100644 index 000000000..d3993eef8 --- /dev/null +++ b/test/fixtures/v5/roundabout_turn/left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "left", + "type": "roundabout turn" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "At the roundabout turn left towards City 1" +} diff --git a/test/fixtures/v5/roundabout_turn/right_destinations.json b/test/fixtures/v5/roundabout_turn/right_destinations.json new file mode 100644 index 000000000..66af83322 --- /dev/null +++ b/test/fixtures/v5/roundabout_turn/right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "right", + "type": "roundabout turn" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "At the roundabout turn right towards City 1" +} diff --git a/test/fixtures/v5/roundabout_turn/sharp_left_destinations.json b/test/fixtures/v5/roundabout_turn/sharp_left_destinations.json new file mode 100644 index 000000000..e55874dbf --- /dev/null +++ b/test/fixtures/v5/roundabout_turn/sharp_left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp left", + "type": "roundabout turn" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "At the roundabout make a sharp left towards City 1" +} diff --git a/test/fixtures/v5/roundabout_turn/sharp_right_destinations.json b/test/fixtures/v5/roundabout_turn/sharp_right_destinations.json new file mode 100644 index 000000000..78846b36a --- /dev/null +++ b/test/fixtures/v5/roundabout_turn/sharp_right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "sharp right", + "type": "roundabout turn" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "At the roundabout make a sharp right towards City 1" +} diff --git a/test/fixtures/v5/roundabout_turn/slight_left_destinations.json b/test/fixtures/v5/roundabout_turn/slight_left_destinations.json new file mode 100644 index 000000000..446308d28 --- /dev/null +++ b/test/fixtures/v5/roundabout_turn/slight_left_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "slight left", + "type": "roundabout turn" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "At the roundabout make a slight left towards City 1" +} diff --git a/test/fixtures/v5/roundabout_turn/slight_right_destinations.json b/test/fixtures/v5/roundabout_turn/slight_right_destinations.json new file mode 100644 index 000000000..96bf1428b --- /dev/null +++ b/test/fixtures/v5/roundabout_turn/slight_right_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "type": "roundabout turn", + "modifier": "slight right" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "At the roundabout make a slight right towards City 1" +} diff --git a/test/fixtures/v5/roundabout_turn/straight_destinations.json b/test/fixtures/v5/roundabout_turn/straight_destinations.json new file mode 100644 index 000000000..0e5233468 --- /dev/null +++ b/test/fixtures/v5/roundabout_turn/straight_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "type": "roundabout turn", + "modifier": "straight" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "At the roundabout continue straight" +} diff --git a/test/fixtures/v5/roundabout_turn/straight_no_name.json b/test/fixtures/v5/roundabout_turn/straight_no_name.json index 4d313c1d7..27d7f52db 100644 --- a/test/fixtures/v5/roundabout_turn/straight_no_name.json +++ b/test/fixtures/v5/roundabout_turn/straight_no_name.json @@ -1,10 +1,10 @@ { "step": { - "name": "", "maneuver": { "type": "roundabout turn", "modifier": "straight" - } + }, + "name": "" }, "instruction": "At the roundabout continue straight" -} \ No newline at end of file +} diff --git a/test/fixtures/v5/roundabout_turn/turn_right.json b/test/fixtures/v5/roundabout_turn/turn_right.json deleted file mode 100644 index 4b161010e..000000000 --- a/test/fixtures/v5/roundabout_turn/turn_right.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "step": { - "name": "Street Name", - "maneuver": { - "type": "roundabout turn", - "modifier": "right" - } - }, - "instruction": "At the roundabout turn right onto Street Name", - "testName": "roundabout turn right non-default case" -} \ No newline at end of file diff --git a/test/fixtures/v5/roundabout_turn/uturn_destinations.json b/test/fixtures/v5/roundabout_turn/uturn_destinations.json new file mode 100644 index 000000000..6bb8da04b --- /dev/null +++ b/test/fixtures/v5/roundabout_turn/uturn_destinations.json @@ -0,0 +1,11 @@ +{ + "step": { + "maneuver": { + "modifier": "uturn", + "type": "roundabout turn" + }, + "name": "Street Name", + "destinations": "City 1,City 2" + }, + "instruction": "At the roundabout make a uturn towards City 1" +} diff --git a/test/fixtures/v5/use_lane/oox.json b/test/fixtures/v5/use_lane/oox.json new file mode 100644 index 000000000..e025ad7de --- /dev/null +++ b/test/fixtures/v5/use_lane/oox.json @@ -0,0 +1,25 @@ +{ + "step": { + "name": "Street Name", + "maneuver": { + "type": "use lane", + "modifier": "left" + }, + "intersections": [ + { + "lanes": [ + { + "valid": true + }, + { + "valid": true + }, + { + "valid": false + } + ] + } + ] + }, + "instruction": "Keep left to turn left onto Street Name" +} diff --git a/test/fixtures/v5/use_lane/oox_destinations.json b/test/fixtures/v5/use_lane/oox_destinations.json new file mode 100644 index 000000000..91943ffd2 --- /dev/null +++ b/test/fixtures/v5/use_lane/oox_destinations.json @@ -0,0 +1,26 @@ +{ + "step": { + "name": "Street Name", + "destinations": "City 1,City 2", + "maneuver": { + "type": "use lane", + "modifier": "left" + }, + "intersections": [ + { + "lanes": [ + { + "valid": true + }, + { + "valid": true + }, + { + "valid": false + } + ] + } + ] + }, + "instruction": "Keep left to turn left towards City 1" +}