Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Faer <[email protected]>
  • Loading branch information
JeffFaer committed Dec 5, 2024
1 parent 0be29e0 commit a6e57de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion testprog/testprog.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

var (
completions = []string{"bear\tan animal", "bearpaw\ta dessert", "dog", "unicorn\tmythical"}
completionsWithSpecialCharacters = []string{"bash space", "bash\\escape", "bash\\ escaped\\ space", "bash>redirect", "bash#comment", "bash$var", "bash|pipe", "bash;semicolon"}
completionsWithSpecialCharacters = []string{`bash1 space`, `bash2\escape`, `bash3\ escaped\ space`, `bash4>redirect`, `bash5#comment`, `bash6$var`, `bash7|pipe`, `bash8;semicolon`}
specialCharComps = []string{"at@", "equal=", "slash/", "colon:", "period.", "comma,", "letter"}
)

Expand Down
17 changes: 9 additions & 8 deletions tests/bash/comp-tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,17 @@ _completionTests_verifyCompletion "testprog --customComp=f" "firstComp forthComp
if [ "$BASHCOMP_VERSION" = bash2 ]; then
orig_bash_comp_no_sort="${BASH_COMP_NO_SORT}"
BASH_COMP_NO_SORT=1
_completionTests_verifyCompletion "testprog prefix special-chars bash" "bash space bash\\escape bash\\ escaped\\ space bash>redirect bash#comment bash\$var bash|pipe bash;semicolon"
_completionTests_verifyCompletion "testprog prefix special-chars bash\\e" "bash\\escape"
_completionTests_verifyCompletion "testprog prefix special-chars bash" "bash1 space bash2\\escape bash3\\ escaped\\ space bash4>redirect bash5#comment bash6\$var bash7|pipe bash8;semicolon"
_completionTests_verifyCompletion "testprog prefix special-chars bash1" "bash1\ space"
_completionTests_verifyCompletion "testprog prefix special-chars bash2\\e" "bash2\\\\escape"
# TODO: completionTests_verifyCompletion doesn't support testing something
# like this.
#_completionTests_verifyCompletion "testprog prefix special-chars bash\\ e" "bash\\ escaped\\ space"
_completionTests_verifyCompletion "testprog prefix special-chars bash>r" "bash>redirect"
_completionTests_verifyCompletion "testprog prefix special-chars bash#c" "bash#comment"
_completionTests_verifyCompletion "testprog prefix special-chars bash\$v" 'bash$var'
_completionTests_verifyCompletion "testprog prefix special-chars bash|p" "bash|pipe"
_completionTests_verifyCompletion "testprog prefix special-chars bash;s" "bash;semicolon"
#_completionTests_verifyCompletion "testprog prefix special-chars bash3\\ e" "bash\\ escaped\\ space"
_completionTests_verifyCompletion "testprog prefix special-chars bash4>r" "bash4\\>redirect"
_completionTests_verifyCompletion "testprog prefix special-chars bash5#c" "bash5#comment"
_completionTests_verifyCompletion "testprog prefix special-chars bash6\$v" "bash6\\\$var"
_completionTests_verifyCompletion "testprog prefix special-chars bash7|p" "bash7\\|pipe"
_completionTests_verifyCompletion "testprog prefix special-chars bash8;s" "bash8\\;semicolon"
BASH_COMP_NO_SORT="${orig_bash_comp_no_sort}"
fi

Expand Down

0 comments on commit a6e57de

Please sign in to comment.