From 60ff83a5f60d97d764bd76fd9762cd76eefdc983 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Fri, 6 Mar 2020 09:43:06 +0100 Subject: [PATCH] Fix -ci suffix removal --- src/main/java/org/jabref/logic/util/Version.java | 2 +- src/test/java/org/jabref/logic/util/VersionTest.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/util/Version.java b/src/main/java/org/jabref/logic/util/Version.java index 06270ceba67..c98b1d9b007 100644 --- a/src/main/java/org/jabref/logic/util/Version.java +++ b/src/main/java/org/jabref/logic/util/Version.java @@ -29,7 +29,7 @@ public class Version { private static final Version UNKNOWN_VERSION = new Version(); private final static Pattern VERSION_PATTERN = Pattern.compile("(?\\d+)(\\.(?\\d+))?(\\.(?\\d+))?(?-alpha|-beta)?(?-?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"; diff --git a/src/test/java/org/jabref/logic/util/VersionTest.java b/src/test/java/org/jabref/logic/util/VersionTest.java index 580e6deae85..f0b12ad01be 100644 --- a/src/test/java/org/jabref/logic/util/VersionTest.java +++ b/src/test/java/org/jabref/logic/util/VersionTest.java @@ -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()); + } }