Skip to content

Commit

Permalink
Fix get() string pattern matching
Browse files Browse the repository at this point in the history
  • Loading branch information
theJian committed Dec 19, 2024
1 parent 6138897 commit 4a26309
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packman.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ local function select_name_from_source(source)
end

local function normalize_source(source)
if string.match(source, '^https?') or string.match(source, '^git') then
if string.match(source, '^https?:') or string.match(source, '^git@') then
return source
end

Expand Down
28 changes: 28 additions & 0 deletions test/test-get.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
local uv = vim.loop

test('get plugin', function(done)

local installed_count = 0

packman.get('theJian/nvim-hello', function()
expect(test_helper.is_installed('nvim-hello'))
installed_count = installed_count + 1
if installed_count == 2 then
done()
end
end)

packman.get('github/copilot.vim', function()
expect(test_helper.is_installed('copilot.vim'))
installed_count = installed_count + 1
if installed_count == 2 then
done()
end
end)
end)

test('get plugin with https', function(done)
packman.get('https://github.com/theJian/nvim-hello.git', function()
expect(test_helper.is_installed('nvim-hello'))
done()
end)
end)

test('get plugin with ssh', function(done)
packman.get('[email protected]:theJian/nvim-hello.git', function()
expect(test_helper.is_installed('nvim-hello'))
done()
end)
Expand Down

0 comments on commit 4a26309

Please sign in to comment.