File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
test/PowerShellEditorServices.Test/Session Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 6
6
using System . Threading ;
7
7
using System . Threading . Tasks ;
8
8
using Microsoft . Extensions . Logging . Abstractions ;
9
- using Microsoft . PowerShell . EditorServices . Services . PowerShell . Host ;
10
9
using Microsoft . PowerShell . EditorServices . Services . PowerShell . Console ;
10
+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Execution ;
11
+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Host ;
11
12
using Xunit ;
12
13
13
14
namespace Microsoft . PowerShell . EditorServices . Test . Console
@@ -41,6 +42,19 @@ public async Task CanExecutePSCommand()
41
42
Assert . Equal ( "foo" , result [ 0 ] ) ;
42
43
}
43
44
45
+ [ Fact ] // https://github.com/PowerShell/vscode-powershell/issues/3677
46
+ public async Task CanHandleThrow ( )
47
+ {
48
+ // TODO: Fix this so it doesn't throw!
49
+ _ = await Assert . ThrowsAsync < ArgumentOutOfRangeException > ( ( ) =>
50
+ {
51
+ return psesHost . ExecutePSCommandAsync (
52
+ new PSCommand ( ) . AddScript ( "throw" ) ,
53
+ CancellationToken . None ,
54
+ new PowerShellExecutionOptions { ThrowOnError = false } ) ;
55
+ } ) . ConfigureAwait ( true ) ;
56
+ }
57
+
44
58
[ Fact ]
45
59
public async Task CanQueueParallelPSCommands ( )
46
60
{
You can’t perform that action at this time.
0 commit comments