@@ -43,8 +43,8 @@ Describe "UseManifestExportFields" {
43
43
It " suggests corrections for FunctionsToExport with wildcard" {
44
44
$violations = Run- PSScriptAnalyzerRule $testManifestBadFunctionsWildcardPath
45
45
$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 ')"
48
48
}
49
49
50
50
It " detects FunctionsToExport with null" {
@@ -56,7 +56,8 @@ Describe "UseManifestExportFields" {
56
56
It " suggests corrections for FunctionsToExport with null and line wrapping" {
57
57
$violations = Run- PSScriptAnalyzerRule $testManifestBadFunctionsNullPath
58
58
$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
60
61
}
61
62
62
63
It " detects array element containing wildcard" {
@@ -84,7 +85,7 @@ Describe "UseManifestExportFields" {
84
85
It " suggests corrections for AliasesToExport with wildcard" {
85
86
$violations = Run- PSScriptAnalyzerRule $testManifestBadAliasesWildcardPath
86
87
$violationFilepath = Join-path $testManifestPath $testManifestBadAliasesWildcardPath
87
- Test-CorrectionExtent $violationFilepath $violations [0 ] 1 " '*'" " @('gfoo ', 'gbar ')"
88
+ Test-CorrectionExtent $violationFilepath $violations [0 ] 1 " '*'" " @('gbar ', 'gfoo ')"
88
89
}
89
90
90
91
It " detects all the *ToExport violations" {
0 commit comments