From dc6b91a672bdd8ef9eb475e9b4221f09bb7a994f Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 20 Apr 2017 15:12:31 -0700 Subject: [PATCH] Fix the Read-Host test that fails in OSX (#3609) --- .../Host/assets/Read-Host.Output.expect | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/test/powershell/Host/assets/Read-Host.Output.expect b/test/powershell/Host/assets/Read-Host.Output.expect index a43044ee4a..5e80cb3b01 100755 --- a/test/powershell/Host/assets/Read-Host.Output.expect +++ b/test/powershell/Host/assets/Read-Host.Output.expect @@ -9,19 +9,13 @@ set timeout 60 spawn $powershell -nologo -noprofile Read-Host prompt -expect "prompt: $" { - send "input\r" +expect { + "prompt: $" { send "input\r" ; exp_continue } + "input\r\ninput\r" { exit 2 } + "input\r\n" { exit 0 } } -# 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 +# ExitCode: 2 -- this is the old, incorrect behavior +# ExitCode: 0 -- this is the expected behavior +# ExitCode: 1 -- anything else is wrong exit 1