From: David ‘Bombe’ Roden Date: Thu, 27 Jun 2019 07:49:04 +0000 (+0200) Subject: 🐛 Remove first character of version string before parsing X-Git-Tag: v80^2~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=df173301a8c208790632901096f3e66d0bbee716;p=Sone.git 🐛 Remove first character of version string before parsing --- 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