Add Read-Host regression test

This commit is contained in:
Andrew Schwartzmeyer authored and Andrew Schwartzmeyer committed 2016-07-08 13:48:51 -07:00
1 parent 68875f0942
commit 8d23dad0ab
2 files changed
+47

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/expect -f
exp_internal 1
# Expects path to PowerShell as first argument
set powershell [lindex $argv 0]
set timeout 5
spawn $powershell -nologo -noprofile Read-Host prompt
expect "prompt: $" {
send "input\r"
}
# This is the old, incorrect behavior
expect "input\r\ninput\r" {
exit 2
}
# This is the expected behavior
expect "input\r\n" {
exit 0
}
# Anything else is wrong
exit 1