Files
fish-shell/tests/checks/fish_delta.fish
Johannes Altmanninger d19c927760 status get-file: simplify wrapper
The __fish_data_with_file wrapper was born out of a desire to simplify
handling of file paths that may or may not be embedded into the
fish binary.

Since 95aeb16ca2 (Remove embed-data feature flag, 2025-11-20) this is
no longer needed since almost everything is embedded unconditionally.
The exception is man pages (see a1baf97f54 (Do not embed man pages
in CMake builds, 2025-11-20)), but they use __fish_data_with_directory.
2025-12-29 16:19:48 +01:00

22 lines
903 B
Fish

# RUN: %fish %s
touch $__fish_config_dir/functions/delta-test-custom-function.fish
for path in fish_greeting fish_job_summary
status get-file functions/$path.fish >$__fish_config_dir/functions/$path.fish
end
set -l tmp (sed 's/$/ # Modified/' $__fish_config_dir/functions/fish_greeting.fish)
string join -- \n $tmp >$__fish_config_dir/functions/fish_greeting.fish
fish_delta --no-diff --new |
string match -r '.*\b(?:delta-test|fish_greeting|fish_job_summary)\b.*'
# CHECK: New: {{.*}}/fish/functions/delta-test-custom-function.fish
# CHECK: Changed: {{.*}}/fish/functions/fish_greeting.fish
# CHECK: Unmodified: {{.*}}/fish/functions/fish_job_summary.fish
fish_delta | grep -A1 '\bfunction fish_greeting\b'
# CHECK: -function fish_greeting
# CHECK: - if not set -q fish_greeting
# CHECK: --
# CHECK: +function fish_greeting # Modified
# CHECK: + if not set -q fish_greeting # Modified