Last change
on this file since 8514 was 8514, checked in by Don-vip, 9 years ago |
checkstyle: various checks
|
-
Property svn:eol-style
set to
native
|
File size:
609 bytes
|
Rev | Line | |
---|
[6871] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
| 2 | package org.openstreetmap.josm.tools
|
---|
| 3 |
|
---|
| 4 | class AlphanumComparatorTest extends GroovyTestCase {
|
---|
| 5 |
|
---|
| 6 | void testNumeric() {
|
---|
| 7 | def lst = Arrays.asList("1", "20", "-1", "00999", "100")
|
---|
| 8 | Collections.sort(lst, AlphanumComparator.getInstance())
|
---|
| 9 | assert lst == Arrays.asList("-1", "1", "20", "100", "00999")
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | void testMixed() {
|
---|
| 13 | def lst = Arrays.asList("b1", "b20", "a5", "a00999", "a100")
|
---|
| 14 | Collections.sort(lst, AlphanumComparator.getInstance())
|
---|
| 15 | assert lst == Arrays.asList("a5", "a100", "a00999", "b1", "b20")
|
---|
| 16 | }
|
---|
| 17 |
|
---|
[8514] | 18 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.