@@ -43,10 +43,10 @@ Describe "UseConsistentCasing" {
43
43
44
44
$violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
45
45
$violations.Count | Should - Be 2
46
- $violations [1 ].Extent.Text | Should - Be " -Split"
47
- $violations [1 ].SuggestedCorrections.Text | Should - Be " -split"
48
- $violations [0 ].Extent.Text | Should - Be " -Join"
49
- $violations [0 ].SuggestedCorrections.Text | Should - Be " -join"
46
+ $violations [0 ].Extent.Text | Should - Be " -Split"
47
+ $violations [0 ].SuggestedCorrections.Text | Should - Be " -split"
48
+ $violations [1 ].Extent.Text | Should - Be " -Join"
49
+ $violations [1 ].SuggestedCorrections.Text | Should - Be " -join"
50
50
}
51
51
}
52
52
@@ -97,5 +97,32 @@ function Test-Case {
97
97
98
98
Invoke-FormatterAssertion @Formatter
99
99
}
100
+
101
+ It " Handles -ISplit correctly" {
102
+ $InconsistentlyCasedScript = ' -Split "Hello World"'
103
+ $ConsistentlyCasedScript = ' -split "Hello World"'
104
+
105
+ $Formatter = @ {
106
+ Script = $InconsistentlyCasedScript
107
+ Expected = $ConsistentlyCasedScript
108
+ ViolationCount = 1
109
+ Settings = $settings
110
+ }
111
+
112
+ Invoke-FormatterAssertion @Formatter
113
+ }
114
+ It " [Regression] Does not break PlusPlus or MinusMinus" {
115
+ $InconsistentlyCasedScript = ' $A++; $B--'
116
+ $ConsistentlyCasedScript = ' $A++; $B--'
117
+
118
+ $Formatter = @ {
119
+ Script = $InconsistentlyCasedScript
120
+ Expected = $ConsistentlyCasedScript
121
+ ViolationCount = 0
122
+ Settings = $settings
123
+ }
124
+
125
+ Invoke-FormatterAssertion @Formatter
126
+ }
100
127
}
101
128
}
0 commit comments