git://git.nikiroo.be
/
nikiroo-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3341f01
)
Woops again...
author
Niki Roo
<niki@nikiroo.be>
Mon, 27 Feb 2017 07:19:08 +0000
(08:19 +0100)
committer
Niki Roo
<niki@nikiroo.be>
Mon, 27 Feb 2017 07:19:08 +0000
(08:19 +0100)
VERSION
patch
|
blob
|
blame
|
history
changelog
patch
|
blob
|
blame
|
history
src/be/nikiroo/utils/Version.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/utils/test/VersionTest.java
patch
|
blob
|
blame
|
history
diff --git
a/VERSION
b/VERSION
index 1892b926767774e9ba91f1e584fa71b4c56abb69..31e5c843497c24df077777c05af122d8b3a60ddb 100644
(file)
--- a/
VERSION
+++ b/
VERSION
@@
-1
+1
@@
-1.3.
2
+1.3.
3
diff --git
a/changelog
b/changelog
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
diff --git
a/src/be/nikiroo/utils/Version.java
b/src/be/nikiroo/utils/Version.java
index a8ec3f5b4d1fd899f8056b2b4033f1a4c234ded8..613fcfe54130ef04d4df068091d7e52a26879002 100644
(file)
--- a/
src/be/nikiroo/utils/Version.java
+++ b/
src/be/nikiroo/utils/Version.java
@@
-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;
}
}
}
}
diff --git
a/src/be/nikiroo/utils/test/VersionTest.java
b/src/be/nikiroo/utils/test/VersionTest.java
index 8dc3ba32ad1e6d0c2fb3b880bd1cbf2d03d66c13..75e2cdf04fecff6afce1d2bf5a935aae5d4b231b 100644
(file)
--- 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());
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());
}
});
}
});