disable git when .git does not exist
[liba.git] / python / test / version.py
blob457d180ce45910eedab95a88fb7c576e2119e933
1 #!/usr/bin/env python
2 import os, sys
4 sys.path.insert(0, os.getcwd())
5 if len(sys.argv) > 1:
6 sys.stdout = open(sys.argv[1], "w")
8 import liba # type: ignore
10 print("version", liba.VERSION)
11 print("major:", liba.version.MAJOR)
12 print("minor:", liba.version.MINOR)
13 print("patch:", liba.version.PATCH)
14 print("tweak:", liba.version.TWEAK)
15 assert liba.version(1) > liba.version()
16 assert liba.version() < liba.version(1)
17 assert liba.version(1) >= liba.version()
18 assert liba.version() <= liba.version(1)
19 assert liba.version(0) == liba.version()
20 assert liba.version(1) != liba.version()
21 print(liba.version())
22 print(liba.version(1))
23 print(liba.version(1, 2))
24 print(liba.version(1, 2, 3))
25 print(liba.version.check())
26 v = liba.version()
27 v.parse(b"1.2.3")
28 v.major = v.major
29 v.minor = v.minor
30 v.third = v.third
31 v.extra = v.extra
32 v.alpha = v.alpha