default value of LIBA_CXX is set to 1
[liba.git] / java / test / _version.java
blobf8226d5184c8d149f056b82bf879dca4068d8d64
1 import liba.version;
3 class _version {
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);
18 if (!v000.lt(v001)) {
19 throw new RuntimeException("v000.lt(v001)");
21 if (!v001.gt(v000)) {
22 throw new RuntimeException("v001.gt(v000)");
24 if (!v100.le(v100)) {
25 throw new RuntimeException("v100.le(v100)");
27 if (!v100.ge(v100)) {
28 throw new RuntimeException("v100.ge(v100)");
30 if (!v010.eq(v010)) {
31 throw new RuntimeException("v010.eq(v010)");
33 if (!v010.ne(v001)) {
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);