4 public static void main(String
[] args
) {
5 System
.out
.println(version
.check(0, 0, 0));
6 System
.out
.println("major " + version
.MAJOR
);
7 System
.out
.println("minor " + version
.MINOR
);
8 System
.out
.println("patch " + version
.PATCH
);
9 System
.out
.println("tweak " + version
.TWEAK
);
10 version v000
= new version();
11 version v100
= new version(1);
12 version v010
= new version(0, 1);
13 version v001
= new version(0, 0, 1);
14 System
.out
.println(v000
);
15 System
.out
.println(v100
);
16 System
.out
.println(v010
);
17 System
.out
.println(v001
);
19 throw new RuntimeException("v000.lt(v001)");
22 throw new RuntimeException("v001.gt(v000)");
25 throw new RuntimeException("v100.le(v100)");
28 throw new RuntimeException("v100.ge(v100)");
31 throw new RuntimeException("v010.eq(v010)");
34 throw new RuntimeException("v010.ne(v001)");
36 if (v100
.cmp(v001
.parse("0.0.1")) != 3) {
37 throw new RuntimeException("v100.cmp(v001) == 3");
39 v000
.major(1).minor(2).third(3).extra(4);
40 if (v000
.major() != 1) {
41 throw new RuntimeException("v000.major() != 1");
43 if (v000
.minor() != 2) {
44 throw new RuntimeException("v000.minor() != 2");
46 if (v000
.third() != 3) {
47 throw new RuntimeException("v000.third() != 3");
49 if (v000
.extra() != 4) {
50 throw new RuntimeException("v000.extra() != 4");
52 v000
.alpha(v000
.alpha());
53 System
.out
.println(v000
);