aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-10-19 14:41:42 +0200
committerGitHub <noreply@github.com>2022-10-19 14:41:42 +0200
commit38c3c7f68c0cd442f4faf46569d83c5b8a610c97 (patch)
tree23c655b038ad8c0c1d80fe1aca7eaf5108aeb0f7 /tests
parentchore: update generated code (#575) (diff)
downloadmason-38c3c7f68c0cd442f4faf46569d83c5b8a610c97.tar
mason-38c3c7f68c0cd442f4faf46569d83c5b8a610c97.tar.gz
mason-38c3c7f68c0cd442f4faf46569d83c5b8a610c97.tar.bz2
mason-38c3c7f68c0cd442f4faf46569d83c5b8a610c97.tar.lz
mason-38c3c7f68c0cd442f4faf46569d83c5b8a610c97.tar.xz
mason-38c3c7f68c0cd442f4faf46569d83c5b8a610c97.tar.zst
mason-38c3c7f68c0cd442f4faf46569d83c5b8a610c97.zip
feat(api/command): add --debug flag to :MasonInstall (#576)
Diffstat (limited to 'tests')
-rw-r--r--tests/mason-core/functional/list_spec.lua8
-rw-r--r--tests/mason/api/command_spec.lua13
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/mason-core/functional/list_spec.lua b/tests/mason-core/functional/list_spec.lua
index 029396e3..add9076e 100644
--- a/tests/mason-core/functional/list_spec.lua
+++ b/tests/mason-core/functional/list_spec.lua
@@ -195,4 +195,12 @@ describe("functional: list", function()
local list = { "Person.", "Woman.", "Man.", "Person.", "Woman.", "Camera.", "TV." }
assert.same({ "Person.", "Woman.", "Man.", "Camera.", "TV." }, _.uniq_by(_.identity, list))
end)
+
+ it("should partition lists", function()
+ local words = { "person", "Woman", "Man", "camera", "TV" }
+ assert.same({
+ { "Woman", "Man", "TV" },
+ { "person", "camera" },
+ }, _.partition(_.matches "%u", words))
+ end)
end)
diff --git a/tests/mason/api/command_spec.lua b/tests/mason/api/command_spec.lua
index d2b2215e..14b65619 100644
--- a/tests/mason/api/command_spec.lua
+++ b/tests/mason/api/command_spec.lua
@@ -37,6 +37,19 @@ describe(":MasonInstall", function()
)
it(
+ "should install provided packages in debug mode",
+ async_test(function()
+ local dummy = registry.get_package "dummy"
+ local dummy2 = registry.get_package "dummy2"
+ spy.on(Pkg, "install")
+ vim.cmd [[MasonInstall --debug dummy dummy2]]
+ assert.spy(Pkg.install).was_called(2)
+ assert.spy(Pkg.install).was_called_with(match.is_ref(dummy), { version = nil, debug = true })
+ assert.spy(Pkg.install).was_called_with(match.is_ref(dummy2), { version = nil, debug = true })
+ end)
+ )
+
+ it(
"should open the UI window",
async_test(function()
local dummy = registry.get_package "dummy"