summaryrefslogtreecommitdiff
path: root/tests/actions/addon/test.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-08-18 18:19:16 +0800
committerGitHub <[email protected]>2026-08-18 18:19:16 +0800
commitde769d5574d92a37253d16b9617d998605bfd727 (patch)
tree4a3b03ed803bd9833cf6f35ec52ca9b84afdadd2 /tests/actions/addon/test.lua
parenta6150b0a9bc7cd24081185a1d5acbd6772d5e138 (diff)
parentb884500d812ae3e4f18ef728184b031cf206cb9f (diff)
Merge pull request #7717 from xmake-io/pluginHEADmasterdev
Move some plugins to addons
Diffstat (limited to 'tests/actions/addon/test.lua')
-rw-r--r--tests/actions/addon/test.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/actions/addon/test.lua b/tests/actions/addon/test.lua
index 05818a054..fcc5c2efc 100644
--- a/tests/actions/addon/test.lua
+++ b/tests/actions/addon/test.lua
@@ -467,6 +467,26 @@ function test_install_conflicts(t)
end)
end
+-- an addon is able to take over a builtin plugin, so we can move a deprecated builtin
+-- plugin to an addon, e.g. `xmake format`
+function test_install_override(t)
+
+ -- the builtin plugin is used if we do not install the addon
+ t:require_not(os.iorunv("xmake", {"format", "--help"}):find("Say hello instead of formatting", 1, true))
+
+ _with_addons({"custom-override"}, function ()
+ local out = os.iorunv("xmake", {"format"})
+ t:require(out:find("hello from custom-override", 1, true))
+
+ -- and it should not be reported as a conflict
+ t:require_not(out:find("conflicts", 1, true))
+ t:require(os.iorunv("xmake", {"format", "--help"}):find("Say hello instead of formatting", 1, true))
+ end)
+
+ -- the builtin plugin is used again after removing the addon
+ t:require_not(os.iorunv("xmake", {"format", "--help"}):find("Say hello instead of formatting", 1, true))
+end
+
-- the invalid installs should fail, and the `addon` name is reserved for the addon references
function test_invalid(t)
t:require_not(try { function () os.runv("xmake", {"addon", "--install", "-y", "addon-test-missing"}); return true end })