mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Add regression test for CallDepthOverflow
This commit is contained in:
1 parent
99402343fc
commit
ee582d42d5
1 file changed
+20
@@ -142,4 +142,24 @@ Describe "ConsoleHost unit tests" {
|
||||
EnsureChildHasExited $process
|
||||
}
|
||||
}
|
||||
|
||||
Context "Exception handling" {
|
||||
It "Should handle a CallDepthOverflow" {
|
||||
# Infinite recursion
|
||||
function recurse
|
||||
{
|
||||
recurse $args
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
recurse "args"
|
||||
Throw "Incorrect exception"
|
||||
}
|
||||
catch
|
||||
{
|
||||
$_.FullyQualifiedErrorId | Should Be "CallDepthOverflow"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user