From 84041fb37da079a779b59d7d9a95c85e7ecaece9 Mon Sep 17 00:00:00 2001 From: James Truher Date: Wed, 20 Jul 2016 12:54:59 -0700 Subject: [PATCH] fix Get-PSBreakpoint test to not require 0 as the breakpoint id Essentially, other tests may set breakpoints and the Id is ever increasing, so a test for Id 0 will only be true if this is the first time a breakpoint has been set in this session --- .../Get-PSBreakpoint.Tests.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 index 7c567e8ccd..c08f10f406 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 @@ -13,11 +13,14 @@ { Get-PSBreakpoint -Script $fullScriptPath } | Should Not Throw $Id = (Get-PSBreakpoint -Script $fullScriptPath).Id - $Id | Should be 0 - + # if breakpoints have been set by other tests, the number may or may not be 0 + # so we can't check against a specific number + # however, we can be sure that we're getting an int and that the int is + # greater or equal to 0 + ([int]$Id) -ge 0 | should be $true } - It "sshould be able to get PSBreakpoint with using Variable switch" { + It "should be able to get PSBreakpoint with using Variable switch" { Set-PSBreakpoint -Script $fullScriptPath -Variable "$scriptName" { Get-PSBreakpoint -Variable "$scriptName" -Script $fullScriptPath } | Should Not Throw