Ignore:
Timestamp:
2020-01-10T00:07:20+01:00 (5 years ago)
Author:
simon04
Message:

Refactoring: OsmUtils.splitMultipleValues

File:
1 edited

Legend:

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

    r10945 r15671  
    44import static org.junit.Assert.assertEquals;
    55import static org.junit.Assert.assertTrue;
     6
     7import java.util.Arrays;
     8import java.util.stream.Collectors;
    69
    710import org.junit.Rule;
     
    4043        OsmUtils.createPrimitive("noway name=Foo");
    4144    }
     45
     46    @Test
     47    public void testSplitMultipleValues() {
     48        // examples from https://wiki.openstreetmap.org/wiki/Semi-colon_value_separator
     49        assertEquals(Arrays.asList("B500", "B550"), OsmUtils.splitMultipleValues("B500;B550").collect(Collectors.toList()));
     50        assertEquals(Arrays.asList("B500", "B550"), OsmUtils.splitMultipleValues("B500 ; B550").collect(Collectors.toList()));
     51        assertEquals(Arrays.asList("Tu-Fr 08:00-18:00", "Mo 09:00-18:00", "Sa 09:00-12:00", "closed Aug"),
     52                OsmUtils.splitMultipleValues("Tu-Fr 08:00-18:00;Mo 09:00-18:00;Sa 09:00-12:00;closed Aug").collect(Collectors.toList()));
     53    }
    4254}
Note: See TracChangeset for help on using the changeset viewer.