Changeset 9274 in josm for trunk/test/unit
- Timestamp:
- 2016-01-03T12:13:44+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
r9174 r9274 8 8 import java.net.URL; 9 9 import java.util.Arrays; 10 import java.util.Locale; 10 11 11 12 import org.junit.Assert; … … 163 164 assertEquals("1\n2\n3", Utils.restrictStringLines("1\n2\n3", 4)); 164 165 } 166 167 /** 168 * Test of {@link Utils#getSizeString} method. 169 */ 170 @Test 171 public void testSizeString() throws Exception { 172 assertEquals("0 B", Utils.getSizeString(0, Locale.ENGLISH)); 173 assertEquals("123 B", Utils.getSizeString(123, Locale.ENGLISH)); 174 assertEquals("1023 B", Utils.getSizeString(1023, Locale.ENGLISH)); 175 assertEquals("1.00 kB", Utils.getSizeString(1024, Locale.ENGLISH)); 176 assertEquals("11.7 kB", Utils.getSizeString(12024, Locale.ENGLISH)); 177 assertEquals("8.00 EB", Utils.getSizeString(Long.MAX_VALUE, Locale.ENGLISH)); 178 } 179 180 /** 181 * Test of {@link Utils#getSizeString} method. 182 */ 183 @Test(expected = IllegalArgumentException.class) 184 public void testSizeStringNegative() throws Exception { 185 Utils.getSizeString(-1, Locale.ENGLISH); 186 } 187 165 188 }
Note:
See TracChangeset
for help on using the changeset viewer.