File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,18 @@ function Test-Correction {
3232
3333 $violations = Invoke-ScriptAnalyzer - ScriptDefinition $scriptDef - Settings $settings
3434 $violations.Count | Should Be 1
35- $violations [0 ].SuggestedCorrections[0 ].Text | Should Be $expectedCorrection
35+
36+ # We split the lines because appveyor checks out files with "\n" endings
37+ # on windows, which results in inconsistent line endings between corrections
38+ # and result.
39+ $resultLines = $violations [0 ].SuggestedCorrections[0 ].Text -split " \r?\n"
40+ $expectedLines = $expectedCorrection -split " \r?\n"
41+ $resultLines.Count | Should Be $expectedLines.Count
42+ for ($i = 0 ; $i -lt $resultLines.Count ; $i ++ ) {
43+ $resultLine = $resultLines [$i ]
44+ $expectedLine = $expectedLines [$i ]
45+ $resultLine | Should Be $expectedLine
46+ }
3647}
3748
3849Describe " ProvideCommentHelp" {
You can’t perform that action at this time.
0 commit comments