From a529bff212c966fe95a23196f0c3a92de0367bcd Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 21 Apr 2016 15:59:40 -0700 Subject: [PATCH] Add tests for powershell -? parsing And all other accepted forms. --- test/powershell/CoreConsoleHost.Tests.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/powershell/CoreConsoleHost.Tests.ps1 diff --git a/test/powershell/CoreConsoleHost.Tests.ps1 b/test/powershell/CoreConsoleHost.Tests.ps1 new file mode 100644 index 000000000..f2c3d48f1 --- /dev/null +++ b/test/powershell/CoreConsoleHost.Tests.ps1 @@ -0,0 +1,12 @@ +Describe "CoreConsoleHost unit tests" { + $powershell = Join-Path -Path $PsHome -ChildPath "powershell" + + Context "Command-line parsing" { + + foreach ($x in "--help", "-help", "-h", "-?", "--he", "-hel", "--HELP", "-hEl") { + It "Accepts '$x' as a parameter for help" { + & $powershell -noprofile $x | ?{ $_ -match "usage: powershell" } | Should Not BeNullOrEmpty + } + } + } +}