Ignore:
Timestamp:
2014-01-06T20:42:32+01:00 (10 years ago)
Author:
simon04
Message:

fix #9525 - multiselecting objects does not show differing relation membership correctly in the sidebar

For instance, positions are displayed as 48-49,91,✗.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java

    r6471 r6652  
    55import org.junit.Test;
    66import org.openstreetmap.josm.Main;
    7 import org.openstreetmap.josm.data.Preferences;
    87
    98import java.io.BufferedReader;
    109import java.net.URL;
     10import java.util.Arrays;
     11
     12import static org.hamcrest.CoreMatchers.is;
     13import static org.junit.Assert.assertThat;
    1114
    1215/**
     
    8790        x.close();
    8891    }
     92
     93    @Test
     94    public void testPositionListString() throws Exception {
     95        assertThat(Utils.getPositionListString(Arrays.asList(1)), is("1"));
     96        assertThat(Utils.getPositionListString(Arrays.asList(1, 2, 3)), is("1-3"));
     97        assertThat(Utils.getPositionListString(Arrays.asList(3, 1, 2)), is("1-3"));
     98        assertThat(Utils.getPositionListString(Arrays.asList(1, 2, 3, 6, 7, 8)), is("1-3,6-8"));
     99        assertThat(Utils.getPositionListString(Arrays.asList(1, 5, 2, 6, 7)), is("1-2,5-7"));
     100    }
    89101}
Note: See TracChangeset for help on using the changeset viewer.