2017-11-09 18:42:54 -05:00
|
|
|
After:
|
|
|
|
call ale#semver#ResetVersionCache()
|
|
|
|
|
2019-04-07 09:58:06 -04:00
|
|
|
Execute(ParseVersion should return the version from the lines of output):
|
2017-02-06 06:12:21 -05:00
|
|
|
" We should be able to parse the semver string from flake8
|
2019-04-07 09:58:06 -04:00
|
|
|
AssertEqual [3, 0, 4], ale#semver#ParseVersion([
|
2017-11-09 18:42:54 -05:00
|
|
|
\ '3.0.4 (mccabe: 0.5.2, pyflakes: 1.2.3, pycodestyle: 2.0.0) CPython 2.7.12 on Linux',
|
|
|
|
\ '1.2.3',
|
|
|
|
\])
|
|
|
|
|
2019-04-07 09:58:06 -04:00
|
|
|
Execute(ParseVersion should return an empty list when no vesrion can be found):
|
|
|
|
AssertEqual [], ale#semver#ParseVersion(['x'])
|
|
|
|
AssertEqual [], ale#semver#ParseVersion([])
|
2017-11-09 18:42:54 -05:00
|
|
|
|
2019-04-07 09:58:06 -04:00
|
|
|
Execute(ParseVersion should tolerate missing patch numbers):
|
2019-01-27 05:56:02 -05:00
|
|
|
" This goes against the semver spec, but we handle it anyway.
|
2019-04-07 09:58:06 -04:00
|
|
|
AssertEqual [3, 4, 0], ale#semver#ParseVersion(['Version 3.4'])
|
2017-11-09 18:42:54 -05:00
|
|
|
|
|
|
|
Execute(GTE should compare triples correctly):
|
|
|
|
Assert ale#semver#GTE([3, 0, 4], [3, 0, 0])
|
|
|
|
Assert ale#semver#GTE([3, 0, 0], [3, 0, 0])
|
|
|
|
Assert ale#semver#GTE([3, 0, 0], [2, 0, 0])
|
|
|
|
Assert ale#semver#GTE([3, 1, 0], [3, 1, 0])
|
|
|
|
Assert ale#semver#GTE([3, 2, 0], [3, 1, 0])
|
|
|
|
Assert ale#semver#GTE([3, 2, 2], [3, 1, 6])
|
|
|
|
Assert ale#semver#GTE([3, 2, 5], [3, 2, 5])
|
|
|
|
Assert ale#semver#GTE([3, 2, 6], [3, 2, 5])
|
|
|
|
Assert !ale#semver#GTE([2, 9, 1], [3, 0, 0])
|
|
|
|
Assert !ale#semver#GTE([3, 2, 3], [3, 3, 3])
|
|
|
|
Assert !ale#semver#GTE([3, 3, 2], [3, 3, 3])
|
|
|
|
|
|
|
|
Execute(GTE should compare pairs correctly):
|
|
|
|
Assert ale#semver#GTE([3, 0], [3, 0, 0])
|
|
|
|
Assert ale#semver#GTE([3, 0], [3, 0])
|
|
|
|
Assert ale#semver#GTE([3, 1], [3, 0])
|
|
|
|
Assert ale#semver#GTE([3, 1], [3, 0, 0])
|
|
|
|
Assert ale#semver#GTE([3, 0, 1], [3, 0])
|
|
|
|
Assert !ale#semver#GTE([3, 0], [3, 0, 1])
|
|
|
|
Assert !ale#semver#GTE([3, 0], [3, 1])
|
|
|
|
Assert !ale#semver#GTE([2, 9, 11], [3, 0])
|
2017-02-06 06:12:21 -05:00
|
|
|
|
2017-11-09 18:42:54 -05:00
|
|
|
Execute(GTE should permit the LHS to be an empty List):
|
|
|
|
Assert !ale#semver#GTE([], [0, 0, 0])
|