mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 01:15:12 +03:00
Get a small unit testable repro of #428
This commit is contained in:
parent
42d833ec3f
commit
c256c5ebee
10
tests/goldenfiles/divided_highway_split.txt
Normal file
10
tests/goldenfiles/divided_highway_split.txt
Normal file
@ -0,0 +1,10 @@
|
||||
TurnID(Lane #2, Lane #6, Intersection #0) is a SharedSidewalkCorner
|
||||
TurnID(Lane #4, Lane #9, Intersection #0) is a Right
|
||||
TurnID(Lane #4, Lane #10, Intersection #0) is a Right
|
||||
TurnID(Lane #5, Lane #11, Intersection #0) is a SharedSidewalkCorner
|
||||
TurnID(Lane #6, Lane #2, Intersection #0) is a SharedSidewalkCorner
|
||||
TurnID(Lane #6, Lane #11, Intersection #0) is a Crosswalk
|
||||
TurnID(Lane #7, Lane #0, Intersection #0) is a Right
|
||||
TurnID(Lane #7, Lane #1, Intersection #0) is a Right
|
||||
TurnID(Lane #11, Lane #5, Intersection #0) is a SharedSidewalkCorner
|
||||
TurnID(Lane #11, Lane #6, Intersection #0) is a Crosswalk
|
47
tests/input/divided_highway_split.osm
Normal file
47
tests/input/divided_highway_split.osm
Normal file
@ -0,0 +1,47 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Resembles https://www.openstreetmap.org/node/2706256854: a two-way road splits into a divided highway. -->
|
||||
<osm>
|
||||
<bounds minlon="0.0" maxlon="0.001" minlat="0.0" maxlat="0.001"/>
|
||||
<node id="1" lon="0.0005" lat="0.0005"/>
|
||||
<node id="2" lon="0.9" lat="-0.2"/>
|
||||
<node id="3" lon="0.9" lat="0.2"/>
|
||||
<node id="4" lon="-0.1" lat="0.0005"/>
|
||||
<node id="5" lon="1.0" lat="0.0005"/>
|
||||
<way id="100">
|
||||
<nd ref="1"/>
|
||||
<nd ref="2"/>
|
||||
<tag k="name" v="outbound"/>
|
||||
<tag k="highway" v="residential"/>
|
||||
|
||||
<tag k="dual_carriageway" v="yes"/>
|
||||
<tag k="lanes" v="2"/>
|
||||
<tag k="oneway" v="yes"/>
|
||||
</way>
|
||||
<way id="101">
|
||||
<nd ref="3"/>
|
||||
<nd ref="1"/>
|
||||
<tag k="name" v="inbound"/>
|
||||
<tag k="highway" v="residential"/>
|
||||
|
||||
<tag k="dual_carriageway" v="yes"/>
|
||||
<tag k="lanes" v="2"/>
|
||||
<tag k="oneway" v="yes"/>
|
||||
</way>
|
||||
<way id="102">
|
||||
<nd ref="1"/>
|
||||
<nd ref="4"/>
|
||||
<tag k="name" v="bidi"/>
|
||||
<tag k="highway" v="residential"/>
|
||||
<tag k="sidewalk" v="both"/>
|
||||
<tag k="lanes" v="4"/>
|
||||
<tag k="lanes:forward" v="2"/>
|
||||
<tag k="lanes:backward" v="2"/>
|
||||
</way>
|
||||
<relation id="1000">
|
||||
<member type="way" ref="101" role="from"/>
|
||||
<member type="node" ref="1" role="via"/>
|
||||
<member type="way" ref="100" role="to"/>
|
||||
<tag k="type" v="restriction"/>
|
||||
<tag k="restriction" v="no_left_turn"/>
|
||||
</relation>
|
||||
</osm>
|
@ -25,7 +25,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// when they change. The goldenfiles (and changes to them) themselves aren't easy to understand,
|
||||
/// but the test maps are.
|
||||
fn test_map_importer() -> Result<(), std::io::Error> {
|
||||
for name in vec!["left_turn_and_bike_lane", "multiple_left_turn_lanes"] {
|
||||
for name in vec![
|
||||
"divided_highway_split",
|
||||
"left_turn_and_bike_lane",
|
||||
"multiple_left_turn_lanes",
|
||||
] {
|
||||
// TODO It's kind of a hack to reference the crate's directory relative to the data dir.
|
||||
let map = import_map(abstutil::path(format!("../tests/input/{}.osm", name)));
|
||||
// Enable to debug the result wih the normal GUI
|
||||
|
Loading…
Reference in New Issue
Block a user