mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-24 12:53:59 +00:00
#692 - MigrationVersion parses version "0.1.1-SNAPSHOT" as "0.1"
This commit is contained in:
@@ -168,7 +168,7 @@ public class MigrationVersion implements Comparable<MigrationVersion> {
|
||||
|
||||
value = value.replace('_', '.');
|
||||
|
||||
String[] sections = value.split("\\.");
|
||||
String[] sections = value.split("[\\.-]");
|
||||
|
||||
if ("r".equalsIgnoreCase(sections[0])) {
|
||||
// a "repeatable" version (does not have a version number)
|
||||
|
||||
@@ -30,6 +30,22 @@ public class MigrationVersionTest {
|
||||
assertThat(list.get(4).getComment()).isEqualTo("beta");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_parse_hyphenSnapshot() {
|
||||
|
||||
MigrationVersion version = MigrationVersion.parse("0.1.1-SNAPSHOT");
|
||||
assertThat(version.normalised()).isEqualTo("0.1.1");
|
||||
assertThat(version.getComment()).isEqualTo("");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_parse_hyphenSnapshot_when_underscores() {
|
||||
|
||||
MigrationVersion version = MigrationVersion.parse("0_1_1-SNAPSHOT__Foo");
|
||||
assertThat(version.normalised()).isEqualTo("0.1.1");
|
||||
assertThat(version.getComment()).isEqualTo("Foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_parse_when_repeatable() throws Exception {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user