diff options
author | Alexander Morozov <[email protected]> | 2014-10-01 13:03:10 +0700 |
---|---|---|
committer | Alexander Morozov <[email protected]> | 2014-10-01 13:03:10 +0700 |
commit | a94794c432801d0dded3ee0591d1b40ef45a5788 (patch) | |
tree | 9c588c8ce2a09d291862432fc899c10e40ed1bf6 | |
parent | af0bc31fbb6f8084d1aeb1eff45530414db1fce9 (diff) |
Fix testing for snapshot regression.
-rwxr-xr-x | api/src/main/java/org/semver/Version.java | 2 | ||||
-rwxr-xr-x | api/src/test/java/org/semver/VersionTest.java | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/api/src/main/java/org/semver/Version.java b/api/src/main/java/org/semver/Version.java index 4f73e4f..4cb54db 100755 --- a/api/src/main/java/org/semver/Version.java +++ b/api/src/main/java/org/semver/Version.java @@ -46,7 +46,7 @@ public final class Version implements Comparable<Version> { private static final Pattern DIGITS_ONLY = Pattern.compile("\\d+"); - private static final String SNAPSHOT_VERSION_SUFFIX = "-SNAPSHOT"; + private static final String SNAPSHOT_VERSION_SUFFIX = "SNAPSHOT"; private final int major; private final int minor; diff --git a/api/src/test/java/org/semver/VersionTest.java b/api/src/test/java/org/semver/VersionTest.java index bdefa5a..6fbcf47 100755 --- a/api/src/test/java/org/semver/VersionTest.java +++ b/api/src/test/java/org/semver/VersionTest.java @@ -97,6 +97,11 @@ public class VersionTest { } @Test + public void shouldBeSnapshotVersion() { + Assert.assertTrue(Version.parse("1.5.30-SNAPSHOT").isSnapshot()); + } + + @Test public void isNewer() { Assert.assertTrue(Version.parse("3.2.3").compareTo(Version.parse("3.2-M1-SNAPSHOT")) > 0); Assert.assertTrue(Version.parse("1.0.0").compareTo(Version.parse("0.0.0")) > 0); |