diff --git a/tests/test6.in b/tests/test6.in index dffe5e1a9..0ea772bb9 100644 --- a/tests/test6.in +++ b/tests/test6.in @@ -67,6 +67,11 @@ echo "Expect -AQ -AW:" (complete -C'TestExclusive -A' | sort | string join ' ') echo "Expect no output 1:" (complete -C'TestExclusive -Q') echo "Expect no output 2:" (complete -C'TestExclusive -W') +# Test for optional arguments, like cp's --backup +complete -c TestOptionalArgument -l backup -f -a 'none all simple' +echo "Expect --backup --backup=:" (complete -C'TestOptionalArgument -' | sort | string join ' ') +echo "Expect --backup=all --backup=none --backup=simple:" (complete -C'TestOptionalArgument --backup=' | sort | string join ' ') + # Test that directory completions work correctly if begin; rm -rf test6.tmp.dir; and mkdir test6.tmp.dir; end pushd test6.tmp.dir diff --git a/tests/test6.out b/tests/test6.out index 81c2684a7..6e21926d2 100644 --- a/tests/test6.out +++ b/tests/test6.out @@ -38,6 +38,8 @@ Expect -A -Q -W: -A -Q -W Expect -AQ -AW: -AQ -AW Expect no output 1: Expect no output 2: +Expect --backup --backup=: --backup --backup= +Expect --backup=all --backup=none --backup=simple: --backup=all --backup=none --backup=simple implicit cd complete works no implicit cd complete after 'command' PATH does not cause incorrect implicit cd