Woops again...
authorNiki Roo <niki@nikiroo.be>
Mon, 27 Feb 2017 07:19:08 +0000 (08:19 +0100)
committerNiki Roo <niki@nikiroo.be>
Mon, 27 Feb 2017 07:19:08 +0000 (08:19 +0100)
VERSION
changelog
src/be/nikiroo/utils/Version.java
src/be/nikiroo/utils/test/VersionTest.java

diff --git a/VERSION b/VERSION
index 1892b926767774e9ba91f1e584fa71b4c56abb69..31e5c843497c24df077777c05af122d8b3a60ddb 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.2
+1.3.3
index b5e1d80737b1d85a591fd56fa33b5b311fc41f1a..3e55a30dd25c348f600cde975252fd06fc6f21e7 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,4 +1,4 @@
-Version 1.3.2
+Version 1.3.3
 -------------
 
 New Version class
 -------------
 
 New Version class
index a8ec3f5b4d1fd899f8056b2b4033f1a4c234ded8..613fcfe54130ef04d4df068091d7e52a26879002 100644 (file)
@@ -40,16 +40,17 @@ public class Version {
         *            the version (<tt>MAJOR.MINOR.PATCH</tt>)
         */
        public Version(String version) {
         *            the version (<tt>MAJOR.MINOR.PATCH</tt>)
         */
        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]);
                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;
                } catch (Exception e) {
                        this.major = 0;
                        this.minor = 0;
                        this.patch = 0;
+                       this.version = null;
                }
        }
 
                }
        }
 
index 8dc3ba32ad1e6d0c2fb3b880bd1cbf2d03d66c13..75e2cdf04fecff6afce1d2bf5a935aae5d4b231b 100644 (file)
@@ -32,6 +32,13 @@ class VersionTest extends TestLauncher {
                                                new Version(
                                                                "Doors 98 SE Special Deluxe Edition Pro++ Not-Home")
                                                                .isEmpty());
                                                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());
                        }
                });
 
                        }
                });