-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-completion #75 :
expect
-based test for auto-completion
- Loading branch information
Showing
6 changed files
with
33 additions
and
17 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
@goal goalAaa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
@goal goalCcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
@goal goalBbb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../makesure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
set timeout 1 | ||
|
||
proc checkCompletion { flagPrefix expectedFlag } { | ||
spawn env PS1=bash#\ bash --norc | ||
sleep 0.1 | ||
send " . ../../completion.bash\r" | ||
send " ./makesure $flagPrefix\t" | ||
|
||
expect { | ||
"$expectedFlag" { puts "\nSUCCESS" } | ||
timeout { puts "\nERROR"; exit 1 } | ||
} | ||
} | ||
|
||
checkCompletion "--sel" "selfupdate" | ||
checkCompletion "--res" "resolved" | ||
checkCompletion "goal" "goalAaa" | ||
checkCompletion "-f Makesurefile.txt goal" "goalBbb" | ||
checkCompletion "--file 'Makesurefile with spaces.txt' goal" "goalCcc" | ||
checkCompletion "--file Makesurefile\\ with\\ spaces.txt goal" "goalCcc" | ||
|
||
checkCompletion "-f Makesurefile.t" "Makesurefile.txt" | ||
checkCompletion "--file Makesurefile.t" "Makesurefile.txt" | ||
|
||
checkCompletion "--file Makesurefile\\ w" "spaces.txt" |