From 7e2cba01fb3867ca0b0e43b56cb93d5780dcb36a Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 21 Apr 2022 17:19:36 +0200 Subject: [PATCH] Add a test that runs all available completions Meaning completions where we have the command. No completion should be printing anything when sourced. This could have prevented #8896 --- tests/checks/check-completions.fish | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/checks/check-completions.fish diff --git a/tests/checks/check-completions.fish b/tests/checks/check-completions.fish new file mode 100644 index 000000000..e9ce18cd1 --- /dev/null +++ b/tests/checks/check-completions.fish @@ -0,0 +1,9 @@ +#RUN: %fish -C 'set -l fish %fish' %s +# Test all completions where the command exists + +# No output is good output +for f in $__fish_data_dir/completions/*.fish + if command -q (string replace -r '.*/([^/]+).fish' '$1' $f) + $fish $f + end +end