Skip to content

Commit

Permalink
Fix -ci suffix removal
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Mar 6, 2020
1 parent 289142f commit 60ff83a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/util/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Version {
private static final Version UNKNOWN_VERSION = new Version();

private final static Pattern VERSION_PATTERN = Pattern.compile("(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?(?<stage>-alpha|-beta)?(?<dev>-?dev)?.*");
private final static Pattern CI_SUFFIX_PATTERN = Pattern.compile("-ci\\.\\d+$");
private final static Pattern CI_SUFFIX_PATTERN = Pattern.compile("-ci\\.\\d+");

private static final String JABREF_GITHUB_RELEASES = "https://api.github.com/repos/JabRef/JabRef/releases";

Expand Down
6 changes: 6 additions & 0 deletions src/test/java/org/jabref/logic/util/VersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,10 @@ public void ciSuffixShouldBeRemoved() {
Version v50ci = Version.parse("5.0-ci.1");
assertEquals("5.0", v50ci.getFullVersion());
}

@Test
public void ciSuffixShouldBeRemovedIfDateIsPresent() {
Version v50ci = Version.parse("5.0-ci.1--2020-03-06--289142f");
assertEquals("5.0--2020-03-06--289142f", v50ci.getFullVersion());
}
}

0 comments on commit 60ff83a

Please sign in to comment.