a-b-street/abstreet · error

!=

Error message

{} != {}

What it means

Test-only helper in traversable.rs: assert_approx_eq compares two Speed values in meters/second and panics when they differ by more than 0.1 m/s (values printed as mph). This is a sentinel assertion, not a runtime error — it fires when walking_speed_on_incline or bike speed logic regresses beyond tolerance in test_walking_speed_on_incline or test_bike_speed_on_incline.

Solutions

  1. Update the expected speeds in the tests if the incline-speed model was intentionally changed
  2. Fix the regression in walking_speed_on_incline / bike speed calculation
  3. Widen the tolerance only if the new behavior is legitimately within acceptable drift
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at map_model/src/traversable.rs:360 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13). Data as JSON: /api/errors/d3c7d7a106caf4eb. Report an issue: GitHub.

Appendix: source

Thrown at map_model/src/traversable.rs:360

fn assert_approx_eq(s1: Speed, s2: Speed) {
    if (s1.inner_meters_per_second() - s2.inner_meters_per_second()).abs() > 0.1 {
        // Print in mph without rounding
        panic!(
            "{} != {}",
            2.23694 * s1.inner_meters_per_second(),
            2.23694 * s2.inner_meters_per_second()
        );
    }
}

View on GitHub (pinned to 0964f29315)