@@ -5,6 +5,7 @@ $ruleConfiguration = @{
5
5
CheckOpenBrace = $false
6
6
CheckOpenParen = $false
7
7
CheckOperator = $false
8
+ CheckSeparator = $false
8
9
}
9
10
10
11
$settings = @ {
@@ -21,6 +22,7 @@ Describe "UseWhitespace" {
21
22
$ruleConfiguration.CheckOpenBrace = $true
22
23
$ruleConfiguration.CheckOpenParen = $false
23
24
$ruleConfiguration.CheckOperator = $false
25
+ $ruleConfiguration.CheckSeparator = $false
24
26
}
25
27
26
28
It " Should find a violation if an open brace does not follow whitespace" {
@@ -47,6 +49,7 @@ if($true) {}
47
49
$ruleConfiguration.CheckOpenBrace = $false
48
50
$ruleConfiguration.CheckOpenParen = $true
49
51
$ruleConfiguration.CheckOperator = $false
52
+ $ruleConfiguration.CheckSeparator = $false
50
53
}
51
54
52
55
It " Should find violation in an if statement" {
@@ -101,6 +104,7 @@ $x.foo("bar")
101
104
$ruleConfiguration.CheckOpenParen = $false
102
105
$ruleConfiguration.CheckOpenBrace = $false
103
106
$ruleConfiguration.CheckOperator = $true
107
+ $ruleConfiguration.CheckSeparator = $false
104
108
}
105
109
106
110
It " Should find a violation if no whitespace around an assignment operator" {
@@ -137,6 +141,16 @@ $x = 1
137
141
138
142
It " Should not find violation if there are whitespaces of size 1 around an assignment operator" {
139
143
$def = @'
144
+ $x = @"
145
+ "abc"
146
+ "@
147
+ '@
148
+ $violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
149
+ $violations.Count | Should Be 0
150
+ }
151
+
152
+ It " Should not find violation if there are whitespaces of size 1 around an assignment operator for here string" {
153
+ $def = @'
140
154
$x = 1
141
155
'@
142
156
$violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
0 commit comments