Changeset 18195 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2021-09-07T23:46:34+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21300 - NPE in search compiler (patch by taylor.smock)

File:
1 edited

Legend:

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

    r18037 r18195  
    1919import java.util.Set;
    2020
     21import org.junit.Assert;
     22import org.junit.jupiter.api.Test;
     23import org.junit.jupiter.api.Timeout;
     24import org.junit.jupiter.params.ParameterizedTest;
     25import org.junit.jupiter.params.provider.ValueSource;
    2126import org.openstreetmap.josm.TestUtils;
    2227import org.openstreetmap.josm.data.coor.LatLon;
     
    4550import nl.jqno.equalsverifier.EqualsVerifier;
    4651import nl.jqno.equalsverifier.Warning;
    47 import org.junit.Assert;
    48 import org.junit.jupiter.api.Test;
    49 import org.junit.jupiter.api.Timeout;
    5052
    5153/**
     
    145147     */
    146148    @Test
    147     void testRegexpCaseSensitive() throws Exception {
     149    void testRegexpCaseSensitive() throws SearchParseError {
    148150        SearchSetting searchSetting = new SearchSetting();
    149151        searchSetting.regexSearch = true;
     
    829831        sc.match(sc.n2, false);
    830832    }
     833
     834    /**
     835     * Non-regression test for JOSM #21300
     836     * @param searchString search string to test
     837     */
     838    @ParameterizedTest
     839    @ValueSource(strings = {"maxweight<" /* #21300 */, "maxweight>"})
     840    void testNonRegression21300(final String searchString) {
     841        assertThrows(SearchParseError.class, () -> SearchCompiler.compile(searchString));
     842    }
    831843}
Note: See TracChangeset for help on using the changeset viewer.