mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-09 06:14:45 +00:00
fix semver version for -tag tags
This commit is contained in:
parent
e547bb749b
commit
60cd37eca6
@ -231,6 +231,9 @@ public class VersionUtilities {
|
||||
return false;
|
||||
}
|
||||
String[] p = version.split("\\.");
|
||||
if (p[2].contains("-")) {
|
||||
p[2] = p[2].substring(0, p[2].indexOf("-"));
|
||||
}
|
||||
return Utilities.isInteger(p[0]) && Utilities.isInteger(p[1]) && Utilities.isInteger(p[2]);
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,13 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class VersionUtilitiesTest {
|
||||
|
||||
@Test
|
||||
public void isValidSemVer() {
|
||||
assertTrue(VersionUtilities.isSemVer("0.1.1"));
|
||||
assertTrue(VersionUtilities.isSemVer("0.1.1-ballot1"));
|
||||
assertFalse(VersionUtilities.isSemVer("0.1.a"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isThisOrLater_Simple() {
|
||||
assertTrue(VersionUtilities.isThisOrLater("0.1", "0.2"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user