repositories / dotfiles
dotfiles
bugabingas dorkfiles
owned by admin
nushell/tests/carapace-completion.nu
Raw# Run from the nushell config directory: nu --no-config-file tests/carapace-completion.nu
alias g = git
source ../carapace-autoload.nu
let alias_input = 'g che' | commandline complete --input
if $alias_input.place.command != [git che] {
error make {msg: 'alias was not expanded for external completion'}
}
if not ('g che' | commandline complete | any { $in | str starts-with 'checkout' }) {
error make {msg: 'Carapace did not complete git via alias'}
}
if not ('git config.nu' | commandline complete | any { $in == 'config.nu' }) {
error make {msg: 'unmatched positional argument did not fall back to files'}
}
if ('git --zzzznotaflag' | commandline complete | is-not-empty) {
error make {msg: 'unmatched flag unexpectedly fell back to files'}
}