From: Niki Roo Date: Mon, 27 Feb 2017 07:19:08 +0000 (+0100) Subject: Woops again... X-Git-Tag: nikiroo-utils-1.3.4~2 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=b0376a373cca5505d0ab5c620aec7821b8fe3064;p=nikiroo-utils.git Woops again... --- diff --git a/VERSION b/VERSION index 1892b92..31e5c84 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.2 +1.3.3 diff --git a/changelog b/changelog index b5e1d80..3e55a30 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,4 @@ -Version 1.3.2 +Version 1.3.3 ------------- New Version class diff --git a/src/be/nikiroo/utils/Version.java b/src/be/nikiroo/utils/Version.java index a8ec3f5..613fcfe 100644 --- a/src/be/nikiroo/utils/Version.java +++ b/src/be/nikiroo/utils/Version.java @@ -40,16 +40,17 @@ public class Version { * the version (MAJOR.MINOR.PATCH) */ public Version(String version) { - this.version = version; try { String[] tab = version.split("\\."); this.major = Integer.parseInt(tab[0]); this.minor = Integer.parseInt(tab[1]); this.patch = Integer.parseInt(tab[2]); + this.version = version; } catch (Exception e) { this.major = 0; this.minor = 0; this.patch = 0; + this.version = null; } } diff --git a/src/be/nikiroo/utils/test/VersionTest.java b/src/be/nikiroo/utils/test/VersionTest.java index 8dc3ba3..75e2cdf 100644 --- a/src/be/nikiroo/utils/test/VersionTest.java +++ b/src/be/nikiroo/utils/test/VersionTest.java @@ -32,6 +32,13 @@ class VersionTest extends TestLauncher { new Version( "Doors 98 SE Special Deluxe Edition Pro++ Not-Home") .isEmpty()); + + assertEquals( + "Bad input should return [unknown]", + "[unknown]", + new Version( + "Doors 98 SE Special Deluxe Edition Pro++ Not-Home") + .toString()); } });