Changeset 16268 in josm


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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java

    r16260 r16268  
    292292                GBC.eol());
    293293        hintPanel.add(new SearchKeywordRow(hcbSearchString)
    294                 .addKeyword("<i>key</i>", null, tr("matches if ''key'' exists"))
     294                .addKeyword("<i>key:</i>", null, tr("matches if ''key'' exists"))
    295295                .addKeyword("<i>key</i>=<i>value</i>", null, tr("''key'' with exactly ''value''"))
    296296                .addKeyword("<i>key</i>~<i>regexp</i>", null, tr("value of ''key'' matching the regular expression ''regexp''"))
  • 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.