File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
main/java/org/scm4j/commons
test/java/org/scm4j/commons Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,10 @@ public int hashCode() {
135135 public Boolean isEmpty () {
136136 return isEmpty ;
137137 }
138+
139+ public boolean isExact () {
140+ return isSemantic && !isSnapshot ();
141+ }
138142
139143 public boolean isSnapshot () {
140144 return !snapshot .isEmpty ();
Original file line number Diff line number Diff line change @@ -176,4 +176,14 @@ public void toSnapshot() {
176176 assertEquals (new Version ("11-SNAPSHOT" ), new Version ("11" ).toSnapshot ());
177177 assertEquals (new Version ("asd-SNAPSHOT" ), new Version ("asd" ).toSnapshot ());
178178 }
179+
180+ @ Test
181+ public void testIsExact () {
182+ assertFalse (new Version ("11.23.31.41-SNAPSHOT" ).isExact ());
183+ assertTrue (new Version ("11.23.31.41" ).isExact ());
184+ assertFalse (new Version ("-SNAPSHOT" ).isExact ());
185+ assertFalse (new Version ("" ).isExact ());
186+ assertFalse (new Version ("dfgdfg-SNAPSHOT" ).isExact ());
187+
188+ }
179189}
You can’t perform that action at this time.
0 commit comments