Changeset 13336 in josm for trunk/test/unit


Ignore:
Timestamp:
2018-01-19T20:42:21+01:00 (7 years ago)
Author:
Don-vip
Message:

see #15800 - autofix out: issues in overpass queries

File:
1 edited

Legend:

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

    r13335 r13336  
    88import static org.junit.Assert.assertEquals;
    99import static org.junit.Assert.assertNotNull;
     10import static org.junit.Assert.assertNull;
    1011import static org.junit.Assert.assertTrue;
    1112
     
    181182    @Test
    182183    public void testFixQuery() {
     184        assertNull(OverpassDownloadReader.fixQuery(null));
     185
    183186        assertEquals("out meta;", OverpassDownloadReader.fixQuery("out;"));
    184187        assertEquals("out meta;", OverpassDownloadReader.fixQuery("out body;"));
     
    196199        assertEquals("out meta qt;", OverpassDownloadReader.fixQuery("out ids qt;"));
    197200
    198         assertEquals("[timeout:25];\n" +
     201        assertEquals("[out:xml]", OverpassDownloadReader.fixQuery("[out:json]"));
     202        assertEquals("[out:xml]", OverpassDownloadReader.fixQuery("[out:csv(\n" +
     203                "    ::\"id\", amenity, name, operator, opening_hours, \"contact:website\", \"contact:phone\", brand, dispensing, lastcheck\n" +
     204                "  )]"));
     205
     206        assertEquals("[out:xml][timeout:25];\n" +
    199207                "(\n" +
    200208                "  node[\"historic\"=\"ringfort\"];\n" +
     
    202210                ");\n" +
    203211                "out meta;",
    204             OverpassDownloadReader.fixQuery("[timeout:25];\n" +
     212            OverpassDownloadReader.fixQuery("[out:xml][timeout:25];\n" +
    205213                "(\n" +
    206214                "  node[\"historic\"=\"ringfort\"];\n" +
Note: See TracChangeset for help on using the changeset viewer.