Changeset 17987 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2021-07-10T22:54:00+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #20992 - see #17829 - support UTC dates with 6 digits

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java

    r17715 r17987  
    7676        assertEquals(6, in.getNumberOfCoordinates());
    7777    }
     78
     79    /**
     80     * Tests reading another RTKLib pos file with yet another different date format.
     81     * @throws Exception if any error occurs
     82     */
     83    @Test
     84    void testReader3() throws Exception {
     85        RtkLibPosReader in = read("nodist/data/rtklib_example3.pos");
     86        assertEquals(1, in.getNumberOfCoordinates());
     87    }
    7888}
  • trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java

    r17912 r17987  
    103103        assertEquals(481161600000L, DateUtils.fromString("1985-04").getTime());
    104104        assertEquals(473385600000L, DateUtils.fromString("1985").getTime());
     105    }
     106
     107    @Test
     108    void testRtklib() {
     109        // examples taken from rtklib .pos files
     110        assertEquals("2019-04-21T08:20:32Z", DateUtils.parseInstant("2019/04/21 08:20:32").toString());
     111        assertEquals("2019-06-08T08:23:12.123Z", DateUtils.parseInstant("2019/06/08 08:23:12.123").toString());
     112        assertEquals("2021-03-30T15:04:01.123456Z", DateUtils.parseInstant("2021/03/30 15:04:01.123456").toString());
    105113    }
    106114
Note: See TracChangeset for help on using the changeset viewer.