blob: 11ab19f504e952c2ce2b5f575f5ececeac239d9c [file] [log] [blame]
package m4e.maven;
import static org.junit.Assert.*;
import org.junit.Test;
class VersionUtilsTest {
@Test
public void testSort() throws Exception {
def l = [ '1.0', '10.0' ]
l.permutations().each {
assert '[1.0, 10.0]' == VersionUtils.sort( it ).toString()
}
}
@Test
public void testSort_2() throws Exception {
def l = [ '1.10', '10.0' ]
l.permutations().each {
assert '[1.10, 10.0]' == VersionUtils.sort( it ).toString()
}
}
@Test
public void testSort_3() throws Exception {
def l = [ '2.0', '1.5', '1.10', '10.0', '1.17.1' ]
l.permutations().each {
assert '[1.5, 1.10, 1.17.1, 2.0, 10.0]' == VersionUtils.sort( it ).toString()
}
}
@Test
public void testSort_4() throws Exception {
def l = [ '1.a2', '1.b1', '1.a10' ]
l.permutations().each {
assert '[1.a10, 1.a2, 1.b1]' == VersionUtils.sort( it ).toString()
}
}
}