Changeset 9349 in josm for trunk/test/unit/org/openstreetmap


Ignore:
Timestamp:
2016-01-09T12:10:25+01:00 (8 years ago)
Author:
simon04
Message:

see #12083 - Search: improve error message when keyword without a required parameter is used

Example: foo type bar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java

    r9214 r9349  
    22package org.openstreetmap.josm.actions.search;
    33
     4import static org.junit.Assert.assertEquals;
    45import static org.junit.Assert.assertFalse;
    56import static org.junit.Assert.assertThat;
     
    379380        anonymous.match(anonymous.n2, true);
    380381    }
     382
     383    @Test
     384    public void testFooTypeBar() throws Exception {
     385        try {
     386            SearchCompiler.compile("foo type bar");
     387            throw new RuntimeException();
     388        } catch (ParseError parseError) {
     389            assertEquals("<html>Expecting <code>:</code> after <i>type<i>", parseError.getMessage());
     390        }
     391    }
    381392}
Note: See TracChangeset for help on using the changeset viewer.