mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add error stream and information stream tests
for native pipes
This commit is contained in:
@@ -10,9 +10,22 @@ Describe 'minishell for native executables' -Tag 'CI' {
|
||||
}
|
||||
|
||||
It 'gets a hashtable object from minishell' {
|
||||
$output = & powershell { @{'a' = 'b'} }
|
||||
$output = & $powershell { @{'a' = 'b'} }
|
||||
($output | measure).Count | Should Be 1
|
||||
($output.GetType().Name) | Should Be 'Hashtable'
|
||||
$output['a'] | Should Be 'b'
|
||||
}
|
||||
|
||||
It 'gets the error stream from minishell' {
|
||||
$output = & $powershell { Write-Error 'foo' } 2>&1
|
||||
($output | measure).Count | Should Be 1
|
||||
($output.GetType().Name) | Should Be 'ErrorRecord'
|
||||
$output.FullyQualifiedErrorId | Should Be 'Microsoft.PowerShell.Commands.WriteErrorException'
|
||||
}
|
||||
|
||||
It 'gets the information stream from minishell' {
|
||||
$output = & $powershell { Write-Information 'foo' } 6>&1
|
||||
($output.GetType().Name) | Should Be 'InformationRecord'
|
||||
$output | Should Be 'foo'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user