fish-shell/tests/checks/broken-config.fish
Fabian Homborg a33c2f0bce Port config tests to littlecheck
This required a bit of thinking.

What we do is we have one test that fakes $HOME, and then we do the
various config tests there.

The fake config we have is reused and we exercise all of the same codepaths.
2019-06-25 22:31:06 +02:00

21 lines
624 B
Fish

#RUN: %fish -C 'set -g fish %fish' %s
begin
set -l dir $PWD/(dirname (status -f))
set -gx XDG_CONFIG_HOME $dir/broken-config/
set -gx HOME $dir/broken-config/
$fish -l -c 'echo but still going'
# CHECK: broken
# CHECK: but still going
# CHECKERR: fish: Unknown command: syntax-error
# CHECKERR: ~//fish/config.fish (line {{\d+}}):
# CHECKERR: syntax-error
# CHECKERR: ^
# CHECKERR: from sourcing file ~//fish/config.fish
# CHECKERR: called during startup
$fish -c "echo normal command" -C "echo init"
# CHECK: broken
# CHECK: init
# CHECK: normal command
end