Changeset 19092 in josm for trunk/test/unit


Ignore:
Timestamp:
2024-05-31T21:52:43+02:00 (6 months ago)
Author:
stoecker
Message:

fix #23702, see #23621 - improve length unit conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java

    r19089 r19092  
    563563        assertEquals(1.5, Utils.unitToMeter("150cm"));
    564564        assertEquals(1.6, Utils.unitToMeter("1600.0mm"));
     565        assertEquals(1700, Utils.unitToMeter("1.7km"));
     566        assertEquals(-1800, Utils.unitToMeter("-1.8km"));
    565567        assertEquals(3.048, Utils.unitToMeter("10ft"));
    566568        assertEquals(6.096, Utils.unitToMeter("20'"));
    567569        assertEquals(2.54, Utils.unitToMeter("100in"));
    568570        assertEquals(5.08, Utils.unitToMeter("200\""));
     571        assertEquals(1852, Utils.unitToMeter("1nmi"));
     572        assertEquals(1609.344, Utils.unitToMeter("1mi"));
    569573        assertEquals(3.0734, Utils.unitToMeter("10ft1in"));
    570574        assertEquals(6.1468, Utils.unitToMeter("20'2\""));
     575        assertEquals(-6.1468, Utils.unitToMeter("-20'2\""));
    571576        assertThrows(IllegalArgumentException.class, () -> Utils.unitToMeter("Hallo"));
    572577    }
Note: See TracChangeset for help on using the changeset viewer.