diff --git a/tests/route/test_fixed_wiring.py b/tests/route/test_fixed_wiring.py index aa1bee8..d5bdfbe 100644 --- a/tests/route/test_fixed_wiring.py +++ b/tests/route/test_fixed_wiring.py @@ -91,3 +91,18 @@ def test_a_fanned_out_signal_is_routed_from_its_via(): assert sig in exact.result.routed_net_numbers assert not exact.result.vias.get(sig), "the fan-out via is already there" assert {names[layer] for layer, _ in exact.result.wires[sig]} == {"B.Cu"} + + +def test_the_session_never_repeats_copper_already_on_the_board(): + # the JAR writes the DSN's wiring back into its session, and an applier + # then adds it a second time on top of itself; freeroute writes only + # what it routed + from freeroute.route.pipeline import build_exact_routing_result + + fixed_vias = {(5000.0, -11500.0), (10000.0, -11500.0)} + fixed_paths = {(5000.0, -10000.0, 5000.0, -11500.0), (10000.0, -10000.0, 10000.0, -11500.0), + (2000.0, -2000.0, 8000.0, -2000.0)} + result = build_exact_routing_result(parse_dsn(_FANOUT), resolution=2) + for net in result.nets: + assert not {(v.x, v.y) for v in net.vias} & fixed_vias + assert not {tuple(w.coords) for w in net.wires} & fixed_paths