From fad0e39cfa3fbe4a077ecf4234b7a3a825210dc4 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 14 Oct 2025 12:43:02 +0200 Subject: [PATCH] tests/fish_update_completions: simple system test --- tests/checks/fish_update_completions.fish | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/checks/fish_update_completions.fish diff --git a/tests/checks/fish_update_completions.fish b/tests/checks/fish_update_completions.fish new file mode 100644 index 000000000..342172ece --- /dev/null +++ b/tests/checks/fish_update_completions.fish @@ -0,0 +1,28 @@ +# RUN: %fish %s +# REQUIRES: command -v sphinx-build + +mkdir -p man/man1 + +echo >man/man1/dirname.1 ' +.SH NAME +dirname \- strip last component from file name +.SH DESCRIPTION +.PP +Output each NAME with its last non\-slash component and trailing slashes +.TP +\fB\-z\fR, \fB\-\-zero\fR +end each output line with NUL, not newline +' + +MANPATH=$PWD/man fish_update_completions +# CHECK: Parsing man pages and writing completions to {{.*}}/generated_completions/ +# CHECK: {{.*}} 1 / 1 : dirname.1{{.*}} + +cd $__fish_cache_dir +find -type f +# CHECK: ./generated_completions/dirname.fish + +cat ./generated_completions/dirname.fish +# CHECK: # dirname +# CHECK: # Autogenerated from man page {{.*}}/man/man1/dirname.1 +# CHECK: complete -c dirname -s z -l zero -d 'end each output line with NUL, not newline'