Ignore:
Timestamp:
2021-07-12T13:33:02+02:00 (3 years ago)
Author:
Don-vip
Message:

fix NPE in TagMap constructor

File:
1 edited

Legend:

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

    r17275 r18006  
    33
    44import static org.junit.jupiter.api.Assertions.assertEquals;
     5
     6import java.util.Arrays;
    57
    68import org.junit.jupiter.api.Test;
     
    1820        assertEquals("TagMap[]", new TagMap().toString());
    1921        assertEquals("TagMap[key=val]", new TagMap(new String[]{"key", "val"}).toString());
    20         assertEquals("TagMap[key=val,foo=bar]", new TagMap(new String[]{"key", "val", "foo", "bar"}).toString());
     22        TagMap foobar = new TagMap(new String[]{"key", "val", "foo", "bar"});
     23        assertEquals("TagMap[key=val,foo=bar]", foobar.toString());
     24        assertEquals("TagMap[key=val,foo=bar]", new TagMap(foobar).toString());
     25        TagCollection coll = new TagCollection(Arrays.asList(new Tag("a", "b")));
     26        assertEquals("TagMap[a=b]", new TagMap(coll).toString());
    2127    }
    2228}
Note: See TracChangeset for help on using the changeset viewer.