@@ -43,8 +43,8 @@ Describe "UseManifestExportFields" {
4343 It " suggests corrections for FunctionsToExport with wildcard" {
4444 $violations = Run- PSScriptAnalyzerRule $testManifestBadFunctionsWildcardPath
4545 $violationFilepath = Join-path $testManifestPath $testManifestBadFunctionsWildcardPath
46- Test-CorrectionExtent $violationFilepath $violations [0 ] 1 " '*'" " @('Get-Foo ', 'Get-Bar ')"
47- $violations [0 ].SuggestedCorrections[0 ].Description | Should Be " Replace '*' with @('Get-Foo ', 'Get-Bar ')"
46+ Test-CorrectionExtent $violationFilepath $violations [0 ] 1 " '*'" " @('Get-Bar ', 'Get-Foo ')"
47+ $violations [0 ].SuggestedCorrections[0 ].Description | Should Be " Replace '*' with @('Get-Bar ', 'Get-Foo ')"
4848 }
4949
5050 It " detects FunctionsToExport with null" {
@@ -56,7 +56,8 @@ Describe "UseManifestExportFields" {
5656 It " suggests corrections for FunctionsToExport with null and line wrapping" {
5757 $violations = Run- PSScriptAnalyzerRule $testManifestBadFunctionsNullPath
5858 $violationFilepath = Join-path $testManifestPath $testManifestBadFunctionsNullPath
59- Test-CorrectionExtent $violationFilepath $violations [0 ] 1 ' $null' " @('Get-Foo1', 'Get-Foo2', 'Get-Foo3', 'Get-Foo4', 'Get-Foo5', 'Get-Foo6', `r`n`t`t 'Get-Foo7', 'Get-Foo8', 'Get-Foo9', 'Get-Foo10', 'Get-Foo11', `r`n`t`t 'Get-Foo12')"
59+ $expectedCorrectionExtent = " @('Get-Foo1', 'Get-Foo10', 'Get-Foo11', 'Get-Foo12', 'Get-Foo2', 'Get-Foo3', {0}`t`t 'Get-Foo4', 'Get-Foo5', 'Get-Foo6', 'Get-Foo7', 'Get-Foo8', {0}`t`t 'Get-Foo9')" -f [System.Environment ]::NewLine
60+ Test-CorrectionExtent $violationFilepath $violations [0 ] 1 ' $null' $expectedCorrectionExtent
6061 }
6162
6263 It " detects array element containing wildcard" {
@@ -84,7 +85,7 @@ Describe "UseManifestExportFields" {
8485 It " suggests corrections for AliasesToExport with wildcard" {
8586 $violations = Run- PSScriptAnalyzerRule $testManifestBadAliasesWildcardPath
8687 $violationFilepath = Join-path $testManifestPath $testManifestBadAliasesWildcardPath
87- Test-CorrectionExtent $violationFilepath $violations [0 ] 1 " '*'" " @('gfoo ', 'gbar ')"
88+ Test-CorrectionExtent $violationFilepath $violations [0 ] 1 " '*'" " @('gbar ', 'gfoo ')"
8889 }
8990
9091 It " detects all the *ToExport violations" {
0 commit comments