Skip to content

Commit c67e81e

Browse files
author
Kapil Borle
committed
Add test for successive close braces
1 parent 83927b3 commit c67e81e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Tests/Rules/PlaceCloseBrace.tests.ps1

+14
Original file line numberDiff line numberDiff line change
@@ -324,5 +324,19 @@ try {
324324
'@
325325
Invoke-Formatter -ScriptDefinition $def -Settings $settings | Should Be $expected
326326
}
327+
328+
It "Should not find violations when a script has two close braces in succession" {
329+
$def = @'
330+
function foo {
331+
if ($true) {
332+
"true"
333+
} else {
334+
"false"
335+
}
336+
}
337+
'@
338+
$violations = Invoke-ScriptAnalyzer -ScriptDefinition $def -Settings $settings
339+
$violations.Count | Should Be 0
340+
}
327341
}
328342
}

0 commit comments

Comments
 (0)