Changeset 16268 in josm for trunk/test


Ignore:
Timestamp:
2020-04-12T11:27:14+02:00 (4 years ago)
Author:
simon04
Message:

see #15943 - SearchDialog: fix search hint to search for existing key

File:
1 edited

Legend:

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

    r16260 r16268  
    540540
    541541    /**
     542     * Test whether a key exists.
     543     * @throws SearchParseError never
     544     */
     545    @Test
     546    public void testKeyExists15943() throws SearchParseError {
     547        Match matcher = SearchCompiler.compile("surface:");
     548        assertTrue(matcher.match(new Tag("surface", "")));
     549        assertTrue(matcher.match(new Tag("surface", "wood")));
     550        assertFalse(matcher.match(new Tag("surface:source", "xxx")));
     551        assertFalse(matcher.match(new Tag("foo", "bar")));
     552        assertFalse(matcher.match(new Tag("name", "foo:surface:bar")));
     553    }
     554
     555    /**
    542556     * Unit test of {@link SearchCompiler.ExactKeyValue.Mode} enum.
    543557     */
Note: See TracChangeset for help on using the changeset viewer.