From df173301a8c208790632901096f3e66d0bbee716 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 27 Jun 2019 09:49:04 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=90=9B=20Remove=20first=20character=20of?= =?utf8?q?=20version=20string=20before=20parsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/main/SonePlugin.java | 2 +- src/test/kotlin/net/pterodactylus/sone/main/VersionParserTest.kt | 8 ++++---- src/test/resources/version.yaml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index 649ebf6..55f2590 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -255,7 +255,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr bind(Context.class).toInstance(context); bind(getOptionalContextTypeLiteral()).toInstance(of(context)); bind(SonePlugin.class).toInstance(SonePlugin.this); - bind(Version.class).toInstance(Version.parse(getVersion())); + bind(Version.class).toInstance(Version.parse(getVersion().substring(1))); bind(PluginVersion.class).toInstance(new PluginVersion(getVersion())); bind(PluginYear.class).toInstance(new PluginYear(getYear())); bind(PluginHomepage.class).toInstance(new PluginHomepage(getHomepage())); diff --git a/src/test/kotlin/net/pterodactylus/sone/main/VersionParserTest.kt b/src/test/kotlin/net/pterodactylus/sone/main/VersionParserTest.kt index f1702ce..fbf1584 100644 --- a/src/test/kotlin/net/pterodactylus/sone/main/VersionParserTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/main/VersionParserTest.kt @@ -25,15 +25,15 @@ class VersionParserTest { @Test fun `default version file is parsed`() { val version = parseVersion()!! - assertThat(version.id, equalTo("43f3e1c3a0f487e37e5851a2cc72756d271c7571")) - assertThat(version.nice, equalTo("0.9.6-466-g43f3e1c")) + assertThat(version.id, equalTo("73241df664f676482d8ca2c13b03d3deac3eacba")) + assertThat(version.nice, equalTo("v79-2-g73241df6")) } @Test fun `parsed version is created correctly`() { val version = parsedVersion!! - assertThat(version.id, equalTo("43f3e1c3a0f487e37e5851a2cc72756d271c7571")) - assertThat(version.nice, equalTo("0.9.6-466-g43f3e1c")) + assertThat(version.id, equalTo("73241df664f676482d8ca2c13b03d3deac3eacba")) + assertThat(version.nice, equalTo("v79-2-g73241df6")) } } diff --git a/src/test/resources/version.yaml b/src/test/resources/version.yaml index 22023b5..1b8dec2 100644 --- a/src/test/resources/version.yaml +++ b/src/test/resources/version.yaml @@ -1,2 +1,2 @@ -id: 43f3e1c3a0f487e37e5851a2cc72756d271c7571 -nice: 0.9.6-466-g43f3e1c +id: 73241df664f676482d8ca2c13b03d3deac3eacba +nice: v79-2-g73241df6 -- 2.7.4