From ff8a79a823957a2d8f833947055d42abebee9b28 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Fri, 29 Sep 2023 16:52:50 +0200 Subject: [PATCH] Add a test for fish_add_path with relative paths --- tests/checks/fish_add_path.fish | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/checks/fish_add_path.fish b/tests/checks/fish_add_path.fish index e854750dd..d47fef959 100644 --- a/tests/checks/fish_add_path.fish +++ b/tests/checks/fish_add_path.fish @@ -36,6 +36,13 @@ fish_add_path -v $tmpdir/link echo $status # CHECK: 0 +# Relative paths are made absolute +set -l oldpwd $PWD +cd $tmpdir +fish_add_path -nv sbin . +# CHECK: set fish_user_paths /{{.*}}/sbin /{{.*}} /{{.*}}/link /{{.*}}/bin +cd $oldpwd + fish_add_path -a $tmpdir/sbin # Not printing anything because it's not verbose, the /sbin should be added at the end. string replace -- $tmpdir '' $fish_user_paths | string join ' '