Skip to content

Commit 05e9bd4

Browse files
author
Alexandra Dorey
committed
Add failng test that should pass
1 parent ea73edc commit 05e9bd4

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Tests/Rules/UseConsistentWhitespace.tests.ps1

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,19 @@ $ht = @{
212212
$ruleConfiguration.CheckSeparator = $false
213213
$ruleConfiguration.IgnoreAssignmentOperatorInsideHashTable = $true
214214
}
215+
It "Should not find violation if assignment operator is in multi-line hash table and a using statement is present" {
216+
$def = @'
217+
using system
218+
219+
$ht = @{
220+
variable = 3
221+
other = 4
222+
}
223+
'@
224+
Invoke-ScriptAnalyzer -ScriptDefinition $def -Settings $settings | Should -Be $null
225+
}
226+
227+
215228
It "Should not find violation if assignment operator is in multi-line hash table" {
216229
$def = @'
217230
$ht = @{
@@ -628,11 +641,11 @@ bar -h i `
628641
}
629642

630643
It "Should fix script when a parameter value is a script block spanning multiple lines" {
631-
$def = {foo {
644+
$def = {foo {
632645
bar
633646
} -baz}
634647

635-
$expected = {foo {
648+
$expected = {foo {
636649
bar
637650
} -baz}
638651
Invoke-Formatter -ScriptDefinition "$def" -Settings $settings |

0 commit comments

Comments
 (0)