Profiles in a dialog, the chip in the map's bottom-left corner picks one (the Design canvas' Vehicle): a car gains fuel, Euro class, stickers and vignettes / toll units with dates; drive mode's Menu steps through them. Speed limits by country for cars and over 3.5 t (public/js/speed_limits.js, sources in it): the route's roads (km, road class, country), the limit shown the lower of the sign and the profile's; the Route panel's countries with their limits and how the motorways are paid; past a border a card in drive mode (GridBorder). The itinerary in the Route panel (Itinerary): the trip's name, leave time, days start; per stop a night, stay and note, planned times, day headers; another screen's change shown where it happened with Undo
This commit is contained in:
1 parent
a6158f4083
commit
5e31dfaba9
15 files changed
+733
-169
No files matched your search
+16
-1
@@ -113,6 +113,19 @@ class RoutingTest < Minitest::Test
|
||||
assert_raises(ArgumentError) { Maptool::Routing.save_vehicles(@data, []) }
|
||||
end
|
||||
|
||||
def test_a_car_keeps_its_fuel_euro_class_stickers_and_vignettes
|
||||
Maptool::Routing.save_vehicles(@data, [{ "id" => "van", "name" => "Van", "fuel" => "diesel", "euro" => "6d", "stickers" => " DE green ",
|
||||
"vignettes" => [{ "country" => "sk", "until" => "2027-01-31" }, { "country" => "AT", "kind" => "toll" }] },
|
||||
{ "id" => "b", "name" => "B", "type" => "bicycle", "fuel" => "diesel" }])
|
||||
assert_equal({ id: "van", name: "Van", type: "car", fuel: "diesel", euro: "6d", stickers: "DE green",
|
||||
vignettes: [{ country: "SK", kind: "vignette", until: "2027-01-31" }, { country: "AT", kind: "toll" }] }, Maptool::Routing.vehicle(@data, "van"))
|
||||
assert_equal({ id: "b", name: "B", type: "bicycle" }, Maptool::Routing.vehicle(@data, "b")) # a bike burns nothing
|
||||
[{ "fuel" => "coal" }, { "euro" => "7" }, { "vignettes" => [{ "country" => "Slovakia" }] }, { "vignettes" => [{ "country" => "SK", "until" => "soon" }] },
|
||||
{ "vignettes" => [{ "country" => "SK", "kind" => "sticker" }] }].each do |bad|
|
||||
assert_raises(ArgumentError) { Maptool::Routing.save_vehicles(@data, [{ "id" => "x", "name" => "X", **bad }]) }
|
||||
end
|
||||
end
|
||||
|
||||
def test_the_old_single_vehicle_becomes_the_camper
|
||||
File.write(File.join(@data, "vehicle.json"), JSON.generate(height: 3.3, width: 2.3, length: 7, weight: 3.5))
|
||||
assert_equal 3.3, Maptool::Routing.vehicle(@data, "camper")[:height]
|
||||
@@ -156,6 +169,7 @@ class RoutingTest < Minitest::Test
|
||||
assert_equal [{ code: "AT", km: 1.5, motorway_km: 1.0, toll_km: 0.0 }, { code: "SK", km: 1.5, motorway_km: 1.5, toll_km: 1.5 }], properties[:countries]
|
||||
assert_equal [[0.0, 130], [1.0, nil], [1.5, 130]], properties[:speed_limits]
|
||||
assert_equal [[9.521034, 47.140974, 1.5]], properties[:signals]
|
||||
assert_equal [[0.0, "motorway", "AT"], [1.0, "primary", "AT"], [1.5, "motorway", "SK"]], properties[:roads]
|
||||
end
|
||||
assert_includes request, %("costing_options":{"auto":{"use_tolls":0.0}})
|
||||
assert_includes request, "/trace_attributes"
|
||||
@@ -163,7 +177,8 @@ class RoutingTest < Minitest::Test
|
||||
|
||||
def test_the_road_driven_is_the_last_matched_edge
|
||||
reply = JSON.generate(edges: [{ names: ["A"], road_class: "primary", speed_limit: 90 }, { names: ["B"], road_class: "motorway", speed_limit: "unlimited", surface: "paved_smooth" }])
|
||||
request = serve_once("HTTP/1.1 200 OK\r\nContent-Length: #{reply.bytesize}\r\n\r\n#{reply}") do |url|
|
||||
no_route = "HTTP/1.1 400 Bad Request\r\nContent-Length: 2\r\n\r\n{}" # the signals ahead: none
|
||||
request = serve_once("HTTP/1.1 200 OK\r\nContent-Length: #{reply.bytesize}\r\n\r\n#{reply}", no_route) do |url|
|
||||
assert_equal({ name: "B", road_class: "motorway", speed_limit: "unlimited", surface: "paved_smooth" }, Maptool::Routing.road(url, [[17.1, 48.1], [17.2, 48.2]]))
|
||||
end
|
||||
assert_includes request, %("shape_match":"map_snap")
|
||||
|
||||
Reference in new issue
Block a user