Changeset 6661 in josm for trunk/test
- Timestamp:
- 2014-01-10T16:39:29+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
r6652 r6661 9 9 import java.net.URL; 10 10 import java.util.Arrays; 11 import java.util.Locale; 11 12 12 13 import static org.hamcrest.CoreMatchers.is; … … 99 100 assertThat(Utils.getPositionListString(Arrays.asList(1, 5, 2, 6, 7)), is("1-2,5-7")); 100 101 } 102 103 @Test 104 public void testDurationString() throws Exception { 105 Locale.setDefault(Locale.ENGLISH); 106 assertThat(Utils.getDurationString(123), is("123 ms")); 107 assertThat(Utils.getDurationString(1234), is("1.2 s")); 108 assertThat(Utils.getDurationString(57 * 1000), is("57.0 s")); 109 assertThat(Utils.getDurationString(507 * 1000), is("8 min 27 s")); 110 assertThat(Utils.getDurationString((long) (8.4 * 60 * 60 * 1000)), is("8 h 24 min")); 111 assertThat(Utils.getDurationString((long) (1.5 * 24 * 60 * 60 * 1000)), is("1 day 12 h")); 112 assertThat(Utils.getDurationString((long) (8.5 * 24 * 60 * 60 * 1000)), is("8 days 12 h")); 113 } 101 114 }
Note:
See TracChangeset
for help on using the changeset viewer.