Changeset 18555 in josm


Ignore:
Timestamp:
2022-09-08T18:22:23+02:00 (21 months ago)
Author:
taylor.smock
Message:

Update tests for new UI information

See #20716: Search for missing power line support features.

This also improves test failure feedback in TestUtils.assertEqualsNewline.
This is done by creating arrays and comparing those, which will help narrow
down where the actual problem was.

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

Legend:

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

    r18434 r18555  
    22package org.openstreetmap.josm;
    33
     4import static org.junit.jupiter.api.Assertions.assertAll;
    45import static org.junit.jupiter.api.Assertions.assertArrayEquals;
    56import static org.junit.jupiter.api.Assertions.assertEquals;
     
    601602     */
    602603    public static void assertEqualsNewline(String expected, String actual) {
    603         assertEquals(expected, actual.replace(System.lineSeparator(), "\n"));
     604        String[] actualArray = actual.split(System.lineSeparator(), -1);
     605        String[] expectedArray = expected.split("\n", -1);
     606        assertAll(() -> assertEquals(expectedArray.length, actualArray.length, "Different number of newlines"),
     607                () -> assertArrayEquals(expectedArray, actualArray),
     608                () -> assertEquals(expected, actual.replace(System.lineSeparator(), "\n")));
    604609    }
    605610
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java

    r17275 r18555  
    3535    @RegisterExtension
    3636    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    37     public JOSMTestRules test = new JOSMTestRules().main().projection().mapStyles();
     37    static JOSMTestRules test = new JOSMTestRules().main().projection().mapStyles();
    3838
    3939    /**
     
    9595                "  Centroid: 47.2686049, 11.3909649\n" +
    9696                "  Length: 193.3 m\n" +
     97                "  Average segment length: 48.3 m\n" +
     98                "  Standard deviation: 27.5 m\n" +
    9799                "  5 Nodes: \n" +
    98100                "    2\n" +
Note: See TracChangeset for help on using the changeset viewer.