Skip to content

Commit

Permalink
https://github.com/jenkinsci/incrementals-tools/pull/24#discussion_r7…
Browse files Browse the repository at this point in the history
…75963963
  • Loading branch information
jglick committed Dec 28, 2021
1 parent 9ccc5ce commit 5b284ba
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import org.apache.maven.artifact.versioning.ComparableVersion;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
Expand All @@ -42,7 +43,9 @@ public class MainTest {
"pr", "dev",
};
@Test public void alphaBeta() {
String sanitized = Main.sanitize("852b473a2b8c");
String hash = "852b473a2b8c";
String sanitized = Main.sanitize(hash);
assertThat(hash + " has been sanitized to the expected format", sanitized, is("852b_473a_2b_8c"));
String canonical = new ComparableVersion(sanitized).getCanonical();
for (String prerelease : PRERELEASE) {
assertThat(sanitized + " treated as a prerelease", canonical, not(containsString(prerelease)));
Expand Down

0 comments on commit 5b284ba

Please sign in to comment.