11package org .scm4j .commons ;
22
3- import static org .junit .Assert .*;
4-
3+ import nl .jqno .equalsverifier .EqualsVerifier ;
54import org .junit .Test ;
65
7- import nl . jqno . equalsverifier . EqualsVerifier ;
6+ import static org . junit . Assert .* ;
87
98public class CoordsTest {
109
@@ -40,8 +39,8 @@ public void testExtension() {
4039 @ Test
4140 public void testClassifier () {
4241 assertEquals ("" , dc ("com.myproject:c1" ).getClassifier ());
43- assertEquals (": " , dc ("com.myproject:c1::" ).getClassifier ());
44- assertEquals (": class" , dc ("com.myproject:c1::class:" ).getClassifier ());
42+ assertEquals ("" , dc ("com.myproject:c1::" ).getClassifier ());
43+ assertEquals ("class" , dc ("com.myproject:c1::class:" ).getClassifier ());
4544 }
4645
4746 @ Test
@@ -50,8 +49,8 @@ public void testToSting() {
5049 assertEquals ("com.myproject: c1:1.0.0" , dc ("com.myproject: c1:1.0.0" ).toString ());
5150 assertEquals (" com.myproject: c1:1.0.0" , dc (" com.myproject: c1:1.0.0" ).toString ());
5251 assertEquals ("com.myproject:c1:1.0.0#comment" , dc ("com.myproject:c1:1.0.0#comment" ).toString ());
53- assertEquals ("com.myproject:c1:1.0.0@ext #comment" , dc ("com.myproject:c1:1.0.0@ext #comment" ).toString ());
54- assertEquals ("com.myproject:c1::dfgd@ext #comment" , dc ("com.myproject:c1::dfgd@ext #comment" ).toString ());
52+ assertEquals ("com.myproject:c1:1.0.0@ext # comment" , dc ("com.myproject:c1:1.0.0@ext # comment" ).toString ());
53+ assertEquals ("com.myproject:c1::dfgd@ext # comment" , dc ("com.myproject:c1::dfgd@ext # comment" ).toString ());
5554 }
5655
5756 @ Test
@@ -85,5 +84,15 @@ public void testEqualsAndHashCode() {
8584 .usingGetClass ()
8685 .verify ();
8786 }
88-
87+
88+ @ Test
89+ public void testVersionChange () {
90+ assertEquals ("eu.untill:JTerminal:12.13 # comment" , new Coords ("eu.untill:JTerminal: # comment" ).toString ("12.13" ));
91+ assertEquals ("eu.untill:JTerminal:12.13:abc@efg # comment" , new Coords ("eu.untill:JTerminal::abc@efg # comment" ).toString ("12.13" ));
92+ assertEquals ("eu.untill:JTerminal::abc@efg # comment" , new Coords ("eu.untill:JTerminal:12.13:abc@efg # comment" ).toString ("" ));
93+ assertEquals ("eu.untill:JTerminal::# comment" , new Coords ("eu.untill:JTerminal:12.13:# comment" ).toString ("" ));
94+ assertEquals ("eu.untill:JTerminal: # comment" , new Coords ("eu.untill:JTerminal:12.13 # comment" ).toString ("" ));
95+ assertEquals ("eu.untill:JTerminal # comment" , new Coords ("eu.untill:JTerminal # comment" ).toString ("" ));
96+ assertEquals ("eu.untill:JTerminal:12.13 # comment" , new Coords ("eu.untill:JTerminal # comment" ).toString ("12.13" ));
97+ }
8998}
0 commit comments