From 3a4149a9e721c5c7d7a1f083ef2e69464f6b4489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=B8rl=C3=BCck=20Berg?= <36937807+henrikhorluck@users.noreply.github.com> Date: Sun, 20 Aug 2023 15:02:54 +0200 Subject: [PATCH] Add test that confirms behavior when PATH is unset --- tests/checks/default-setup-path.fish | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/checks/default-setup-path.fish diff --git a/tests/checks/default-setup-path.fish b/tests/checks/default-setup-path.fish new file mode 100644 index 000000000..8f693ade5 --- /dev/null +++ b/tests/checks/default-setup-path.fish @@ -0,0 +1,11 @@ +#RUN: %fish -C 'set -g fish %fish' %s + +# FIXME: Rationalize behavior when PATH is explicitly unset, should this not behave like PATH=""? +# "" is threated like ".", see https://github.com/fish-shell/fish-shell/issues/3914 +if command -q getconf + env -u PATH $fish -c 'test "$PATH" = "$('(command -s getconf)' PATH)"; and echo Success' +else + # this is DEFAULT_PATH + env -u PATH $fish -c 'test "$PATH" = "/usr/bin:/bin"; and echo Success' +end +# CHECK: Success