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() {
135
135
public Boolean isEmpty () {
136
136
return isEmpty ;
137
137
}
138
+
139
+ public boolean isExact () {
140
+ return isSemantic && !isSnapshot ();
141
+ }
138
142
139
143
public boolean isSnapshot () {
140
144
return !snapshot .isEmpty ();
Original file line number Diff line number Diff line change @@ -176,4 +176,14 @@ public void toSnapshot() {
176
176
assertEquals (new Version ("11-SNAPSHOT" ), new Version ("11" ).toSnapshot ());
177
177
assertEquals (new Version ("asd-SNAPSHOT" ), new Version ("asd" ).toSnapshot ());
178
178
}
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
+ }
179
189
}
You can’t perform that action at this time.
0 commit comments