Allow Set-Clipboard to accept empty string (#14579)

This commit is contained in:
Steve Lee
2021-04-01 13:03:19 -07:00
committed by GitHub
parent c008e3e930
commit cf6876e716
2 changed files with 27 additions and 14 deletions
@@ -41,5 +41,15 @@ Describe 'Clipboard cmdlet tests' -Tag CI {
'world' | Set-Clipboard -Append
Get-Clipboard -Raw | Should -BeExactly "hello$([Environment]::NewLine)world"
}
It 'Set-Clipboard accepts <value> string' -TestCases @(
@{ value = 'empty'; text = "" }
@{ value = 'null' ; text = $null }
){
param ($text)
$text | Set-Clipboard
Get-Clipboard -Raw | Should -BeNullOrEmpty
}
}
}