From ca887b80a911df4db4ab5f5496075b9415b9990a Mon Sep 17 00:00:00 2001 From: Gianmaria Bajo Date: Tue, 6 Jun 2023 15:38:45 +0200 Subject: fix: version-range < and <= #23539 vim.version.range() couldn't parse them correctly. For example, vim.version.range('<0.9.0'):has('0.9.0') returned `true`. fix: range:has() accepts vim.version() So that it's possible to compare a range with: vim.version.range(spec):has(vim.version()) --- test/functional/lua/version_spec.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/functional/lua/version_spec.lua') diff --git a/test/functional/lua/version_spec.lua b/test/functional/lua/version_spec.lua index 75b62e8318..64dcbec983 100644 --- a/test/functional/lua/version_spec.lua +++ b/test/functional/lua/version_spec.lua @@ -40,6 +40,8 @@ describe('version', function() ['=1.2.3'] = { from = { 1, 2, 3 }, to = { 1, 2, 4 } }, ['>1.2.3'] = { from = { 1, 2, 4 } }, ['>=1.2.3'] = { from = { 1, 2, 3 } }, + ['<1.2.3'] = { from = { 0, 0, 0 }, to = { 1, 2, 3 } }, + ['<=1.2.3'] = { from = { 0, 0, 0 }, to = { 1, 2, 4 } }, ['~1.2.3'] = { from = { 1, 2, 3 }, to = { 1, 3, 0 } }, ['^1.2.3'] = { from = { 1, 2, 3 }, to = { 2, 0, 0 } }, ['^0.2.3'] = { from = { 0, 2, 3 }, to = { 0, 3, 0 } }, -- cgit