From b745d75f1b9828dcd0a850d6726d0d46edfbf989 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 15 Jul 2016 13:43:29 -0700 Subject: [PATCH] Test PSReadLine's DefaultEditMode and bindings --- .../powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 index 7821fca3ee..0173b91695 100644 --- a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 +++ b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 @@ -13,6 +13,16 @@ Describe "PSReadLine" { $module.Version | Should Be "1.2" } + It "Should use Emacs Bindings on Linux and OS X" -skip:$IsWindows { + (Get-PSReadLineOption).EditMode | Should Be Emacs + (Get-PSReadlineKeyHandler | where { $_.Key -eq "Ctrl+A" }).Function | Should Be BeginningOfLine + } + + It "Should use Windows Bindings on Windows" -skip:(-not $IsWindows) { + (Get-PSReadLineOption).EditMode | Should Be Windows + (Get-PSReadlineKeyHandler | where { $_.Key -eq "Ctrl+A" }).Function | Should Be SelectAll + } + It "Should set the edit mode" { Set-PSReadlineOption -EditMode Windows (Get-PSReadlineKeyHandler | where { $_.Key -eq "Ctrl+A" }).Function | Should Be SelectAll