diff options
| author | William Boman <william@redwill.se> | 2025-08-02 00:19:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-01 22:19:10 +0000 |
| commit | 9e25c98d4826998460926f8c5c2284848d80ae89 (patch) | |
| tree | 6ba2cce1709bfb1af4d1fd6f48c155ed69b14106 /tests/mason-core/pep440_spec.lua | |
| parent | fix(ui): only set border to none if `'winborder'` doesn't exist (#1984) (diff) | |
| download | mason-9e25c98d4826998460926f8c5c2284848d80ae89.tar mason-9e25c98d4826998460926f8c5c2284848d80ae89.tar.gz mason-9e25c98d4826998460926f8c5c2284848d80ae89.tar.bz2 mason-9e25c98d4826998460926f8c5c2284848d80ae89.tar.lz mason-9e25c98d4826998460926f8c5c2284848d80ae89.tar.xz mason-9e25c98d4826998460926f8c5c2284848d80ae89.tar.zst mason-9e25c98d4826998460926f8c5c2284848d80ae89.zip | |
fix(pypi): add support for "compatible release" (~=) PEP440 expressions (#2000)
Diffstat (limited to 'tests/mason-core/pep440_spec.lua')
| -rw-r--r-- | tests/mason-core/pep440_spec.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/mason-core/pep440_spec.lua b/tests/mason-core/pep440_spec.lua index c8ff9880..7acd0ebf 100644 --- a/tests/mason-core/pep440_spec.lua +++ b/tests/mason-core/pep440_spec.lua @@ -19,4 +19,16 @@ describe("pep440 version checking", function() assert.is_true(pep440.check_version("3.8.1", "!=4.0,<=4.0,>=3.8")) assert.is_true(pep440.check_version("3.12.0", "!=4.0,<=4.0,>=3.8")) end) + + it("should support ~= operators", function() + assert.is_true(pep440.check_version("3.12.0", "~=3.10")) + assert.is_true(pep440.check_version("3.10.4", "~=3.10.0")) + assert.is_true(pep440.check_version("3.12.4", "~=3.0")) + assert.is_true(pep440.check_version("3.12.4", "~=3.12.4")) + + assert.is_false(pep440.check_version("4.0.0", "~=3.10")) + assert.is_false(pep440.check_version("3.11.0", "~=3.10.0")) + assert.is_false(pep440.check_version("3.10.0", "~=3.10.5")) + assert.is_false(pep440.check_version("3.11.0", "~=4.0")) + end) end) |
