fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes Altmanningerconfig: use default XDG_DATA_DIRS when unset or empty923d0b797

master
1.4 KiB39 linesraw
1#RUN: fish=%fish %fish %s
2
3set -e FISH_UNIT_TESTS_RUNNING
4function expect-datadirs
5    $fish -c '
6        for datadir in $argv
7            contains -- $datadir/fish/vendor_functions.d $fish_function_path
8            and echo function_path has $datadir
9            contains -- $datadir/fish/vendor_completions.d $fish_complete_path
10            and echo complete_path has $datadir
11            contains -- $datadir/fish/vendor_conf.d $__fish_vendor_confdirs
12            and echo vendor_conf has $datadir
13        end
14    ' $argv
15end
16
17expect-datadirs /usr/local/share /usr/share
18# CHECK: function_path has /usr/local/share
19# CHECK: complete_path has /usr/local/share
20# CHECK: vendor_conf has /usr/local/share
21# CHECK: function_path has /usr/share
22# CHECK: complete_path has /usr/share
23# CHECK: vendor_conf has /usr/share
24
25XDG_DATA_DIRS= expect-datadirs /usr/local/share /usr/share
26# CHECK: function_path has /usr/local/share
27# CHECK: complete_path has /usr/local/share
28# CHECK: vendor_conf has /usr/local/share
29# CHECK: function_path has /usr/share
30# CHECK: complete_path has /usr/share
31# CHECK: vendor_conf has /usr/share
32
33XDG_DATA_DIRS=/custom/path1:/custom/path2 expect-datadirs /custom/path1 /custom/path2
34# CHECK: function_path has /custom/path1
35# CHECK: complete_path has /custom/path1
36# CHECK: vendor_conf has /custom/path1
37# CHECK: function_path has /custom/path2
38# CHECK: complete_path has /custom/path2
39# CHECK: vendor_conf has /custom/path2