Changeset 17336 in josm for trunk/test/unit


Ignore:
Timestamp:
2020-11-23T19:59:45+01:00 (4 years ago)
Author:
GerdP
Message:

fix #20037: Overpass query wizard generates wrong query with "*=value"

  • remove obsolete getInstance()
  • fix bug and add unit test
Location:
trunk/test/unit/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r17333 r17336  
    5959
    6060    private String getExpandedQuery(String search) {
    61         final String query = SearchCompilerQueryWizard.getInstance().constructQuery(search);
     61        final String query = SearchCompilerQueryWizard.constructQuery(search);
    6262        final String request = new OverpassDownloadReader(new Bounds(1, 2, 3, 4), null, query)
    6363                .getRequestForBbox(1, 2, 3, 4)
  • trunk/test/unit/org/openstreetmap/josm/tools/SearchCompilerQueryWizardTest.java

    r17275 r17336  
    2424
    2525    private static String constructQuery(String s) {
    26         return SearchCompilerQueryWizard.getInstance().constructQuery(s);
     26        return SearchCompilerQueryWizard.constructQuery(s);
    2727    }
    2828
     
    241241                "type:relation and type=multipolygon and -landuse=* and -\"area:highway\"=*");
    242242    }
     243
     244    /**
     245     * Test for ticket <a href="https://josm.openstreetmap.de/ticket/20037>#20037</a>
     246     */
     247    @Test
     248    void testTicket20037() {
     249        assertQueryEquals(
     250                "  node[~\"^.*$\"~\"forward\"];\n" +
     251                "  node[~\"^.*$\"~\"backward\"];\n",
     252                "type:node AND (*=forward OR *=backward)");
     253    }
    243254}
Note: See TracChangeset for help on using the changeset viewer.