Changeset 14518 in josm for trunk/test/unit


Ignore:
Timestamp:
2018-12-07T12:25:31+01:00 (6 years ago)
Author:
GerdP
Message:

fix #17081 correction and unit test

File:
1 edited

Legend:

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

    r14302 r14518  
    706706        assertEquals("0", f.getSummedValues("k"));
    707707    }
     708
     709    /**
     710     * Test method for {@link TagCollection#commonToAllPrimitives(Collection)}.
     711     */
     712    @Test
     713    public void testCommonToAllPrimitives() {
     714        Tagged t1 = new Node();
     715        t1.put("k1", "10");
     716        t1.put("k2", "20");
     717        Tagged t2 = new Node();
     718        t2.put("k2", "20");
     719        TagCollection c = TagCollection.commonToAllPrimitives(Arrays.asList(t1, t2));
     720        assertEquals(1, c.size());
     721        assertFalse(c.hasValuesFor("k1"));
     722        assertTrue(c.hasValuesFor("k2"));
     723        assertEquals(1, c.getValues("k2").size());
     724        assertEquals("20", c.getValues("k2").iterator().next());
     725    }
    708726}
Note: See TracChangeset for help on using the changeset viewer.