MegaBites-AI/Windows-powershell
0372
1# Copyright (c) Microsoft Corporation.2# Licensed under the MIT License.3 4Describe 'Tests for Wait-Debugger' -Tags "CI" {5 BeforeAll {6 Register-DebuggerHandler7 }8 9 AfterAll {10 Unregister-DebuggerHandler11 }12 13 Context 'Wait-Debugger should break on the statement containing the Wait-Debugger command' {14 BeforeAll {15 $testScript = {16 function Test-Break {17 [CmdletBinding()]18 param()19 Wait-Debugger20 'The debugger should break on the previous line, not on this line.'21 }22 Test-Break23 }24 25 $results = @(Test-Debugger -Scriptblock $testScript)26 }27 28 It 'Should show 1 debugger command was invoked' {29 # There is always an implicit 'c' command that keeps the debugger automation moving30 $results.Count | Should -Be 131 }32 33 It 'The breakpoint should be the statement containing Wait-Debugger' {34 $results[0] | ShouldHaveExtent -Line 5 -FromColumn 21 -ToColumn 3435 }36 }37}38 