Test case for autoload + erase + autoload

Commit 5918bca1eb (Make "complete -e" prevent completion autoloading,
2024-08-24) has a weird "!removed" check; it was added because "complete
-e" only needs to create the tombstone if we removed nothing.  Otherwise the
autoloader will usually take care of not loading the removed completions again.
We should probably get rid of "!removed"..  for now add a test to demonstrate
this behavior.
This commit is contained in:
Johannes Altmanninger
2025-05-29 14:20:11 +02:00
parent a7c04890c9
commit 5657f093e7

View File

@@ -1,6 +1,17 @@
#RUN: %fish %s
#RUN: fish=%fish %fish %s
complete -e cat
complete -C"cat -" | wc -l
$fish -c '
complete -e cat
complete -C"cat -" | wc -l
'
# CHECK: 0
# Note: this is *not* handled by the tombstone logic.
# We don't reload cat.fish because it is cached by the autoloader,
# and we don't invalidate the cache.
$fish -c '
complete -C"cat -" >/dev/null
complete -e cat
complete -C"cat -" | wc -l
'
# CHECK: 0