update options for pip installation in README.md
[liba.git] / python / test / version.py
blob314398c3408b81672ef02b1c9e4531d53b3f93d5
1 #!/usr/bin/env python
2 import os, sys
4 base = os.path.dirname(__file__)
5 path = os.path.dirname(base)
6 sys.path.insert(0, path)
7 if len(sys.argv) > 1:
8 sys.stdout = open(sys.argv[1], "w")
10 import liba # type: ignore
12 print("version", liba.VERSION)
13 print("major:", liba.version.MAJOR)
14 print("minor:", liba.version.MINOR)
15 print("patch:", liba.version.PATCH)
16 print("tweak:", liba.version.TWEAK)
17 assert liba.version(1) > liba.version()
18 assert liba.version() < liba.version(1)
19 assert liba.version(1) >= liba.version()
20 assert liba.version() <= liba.version(1)
21 assert liba.version(0) == liba.version()
22 assert liba.version(1) != liba.version()
23 print(liba.version())
24 print(liba.version(1))
25 print(liba.version(1, 2))
26 print(liba.version(1, 2, 3))
27 print(liba.version.check())
28 v = liba.version()
29 v.parse(b"1.2.3")
30 v.major = v.major
31 v.minor = v.minor
32 v.third = v.third
33 v.extra = v.extra
34 v.alpha = v.alpha