aboutsummaryrefslogtreecommitdiff
path: root/t/run.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-01-13 13:19:58 -0500
committerAdam Harrison <adamdharrison@gmail.com>2023-01-13 13:19:58 -0500
commitc88534f4bc0f72d108424f8227d2484083a476eb (patch)
tree22a6cd90f00bf8537a136b695c1a21f2dcd1b881 /t/run.lua
parent0f9fb0343f983418051a88ef630c267e6954f3bb (diff)
downloadlite-xl-plugin-manager-c88534f4bc0f72d108424f8227d2484083a476eb.tar.gz
lite-xl-plugin-manager-c88534f4bc0f72d108424f8227d2484083a476eb.zip
Added in color support, renamed things to addons.
Diffstat (limited to 't/run.lua')
-rw-r--r--t/run.lua35
1 files changed, 28 insertions, 7 deletions
diff --git a/t/run.lua b/t/run.lua
index d0eee36..9ea462f 100644
--- a/t/run.lua
+++ b/t/run.lua
@@ -10,7 +10,7 @@ setmetatable(_G, { __index = function(t, k) if not rawget(t, k) then error("cann
local tests = {
["00_install_singleton"] = function()
- local plugins = lpm("list bracketmatch")["plugins"]
+ local plugins = lpm("list bracketmatch")["addons"]
assert(#plugins == 1)
assert(plugins[1].organization == "singleton")
assert(plugins[1].status == "available")
@@ -22,19 +22,19 @@ local tests = {
end,
["01_upgrade_singleton"] = function()
lpm("install bracketmatch")
- local plugins = lpm("list bracketmatch")["plugins"]
+ local plugins = lpm("list bracketmatch")["addons"]
assert(#plugins == 1)
assert(plugins[1].status == "installed")
assert_exists(plugins[1].path)
io.open(plugins[1].path, "ab"):write("-- this is a test comment to modify the checksum"):close()
- plugins = lpm("list bracketmatch")["plugins"]
+ plugins = lpm("list bracketmatch")["addons"]
assert(#plugins == 2)
lpm("install bracketmatch")
- plugins = lpm("list bracketmatch")["plugins"]
+ plugins = lpm("list bracketmatch")["addons"]
assert(#plugins == 1)
end,
["02_install_complex"] = function()
- local plugins = lpm("list plugin_manager")["plugins"]
+ local plugins = lpm("list plugin_manager")["addons"]
assert(#plugins == 1)
assert(plugins[1].organization == "complex")
assert(plugins[1].status == "available")
@@ -48,14 +48,35 @@ local tests = {
end,
["03_upgrade_complex"] = function()
local actions = lpm("install plugin_manager")
- local plugins = lpm("list plugin_manager")["plugins"]
+ local plugins = lpm("list plugin_manager")["addons"]
assert(#plugins == 1)
assert(plugins[1].organization == "complex")
assert(plugins[1].status == "installed")
end,
["04_list_plugins"] = function()
- local plugins = lpm("list")["plugins"]
+ local plugins = lpm("list")["addons"]
assert(#plugins > 20)
+ end,
+ ["05_install_url"] = function()
+ local plugins = lpm("list language_ksy")["addons"]
+ assert(#plugins == 1)
+ assert(plugins[1].organization == "singleton")
+ assert(plugins[1].status == "available")
+ local actions = lpm("install language_ksy")
+ assert_exists(userdir .. "/plugins/language_ksy.lua")
+ end,
+ ["06_install_stub"] = function()
+ local plugins = lpm("list lsp")["addons"]
+ assert(#plugins > 1)
+ for i, plugin in ipairs(plugins) do
+ if plugin.id == "lsp" then
+ assert(plugins[1].organization == "complex")
+ assert(plugins[1].status == "available")
+ local actions = lpm("install lsp")
+ assert_exists(userdir .. "/plugins/lsp/init.lua")
+ break
+ end
+ end
end
}