mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Autocorrected CRLF to LF (#4943)
Also, fix `Parser.Tests.ps1` after correcting CRLF.
This commit is contained in:
@@ -31,17 +31,17 @@ Describe "New-ModuleManifest tests" -tags "CI" {
|
||||
$module.PrivateData.PSData.ProjectUri | Should BeExactly $absoluteUri
|
||||
}
|
||||
|
||||
function TestNewModuleManifestEncoding {
|
||||
param ([byte[]]$expected)
|
||||
function TestNewModuleManifestEncoding {
|
||||
param ([byte[]]$expected)
|
||||
New-ModuleManifest -Path $testModulePath
|
||||
(Get-Content -Encoding Byte -Path $testModulePath -TotalCount $expected.Length) -join ',' | Should Be ($expected -join ',')
|
||||
(Get-Content -Encoding Byte -Path $testModulePath -TotalCount $expected.Length) -join ',' | Should Be ($expected -join ',')
|
||||
}
|
||||
|
||||
It "Verify module manifest encoding" {
|
||||
|
||||
# verify first line of the manifest:
|
||||
# on Windows platforms - 3 characters - '#' '\r' '\n' - in UTF-16 with BOM - this should be @(255,254,35,0,13,0,10,0)
|
||||
# on non-Windows platforms - 2 characters - '#' '\n' - in UTF-8 no BOM - this should be @(35,10)
|
||||
|
||||
# verify first line of the manifest:
|
||||
# on Windows platforms - 3 characters - '#' '\r' '\n' - in UTF-16 with BOM - this should be @(255,254,35,0,13,0,10,0)
|
||||
# on non-Windows platforms - 2 characters - '#' '\n' - in UTF-8 no BOM - this should be @(35,10)
|
||||
TestNewModuleManifestEncoding -expected $ExpectedManifestBytes
|
||||
}
|
||||
|
||||
|
||||
@@ -18,25 +18,25 @@
|
||||
"function TestModuleFunction{'Hello from TestModuleFunction'}" | Out-File $nestedModuleFilePath
|
||||
}
|
||||
|
||||
$testCases = @(
|
||||
@{ SubModulePath = "$submoduleName" }
|
||||
@{ SubModulePath = "$submoduleName\$submoduleName" }
|
||||
@{ SubModulePath = "$submoduleName/$submoduleName" }
|
||||
@{ SubModulePath = "$submoduleName\$submoduleFileName" }
|
||||
@{ SubModulePath = "$submoduleName/$submoduleFileName" }
|
||||
@{ SubModulePath = ".\$submoduleName" }
|
||||
@{ SubModulePath = ".\$submoduleName\$submoduleName" }
|
||||
@{ SubModulePath = ".\$submoduleName/$submoduleName" }
|
||||
@{ SubModulePath = ".\$submoduleName\$submoduleFileName" }
|
||||
@{ SubModulePath = ".\$submoduleName/$submoduleFileName" }
|
||||
@{ SubModulePath = "./$submoduleName" }
|
||||
@{ SubModulePath = "./$submoduleName/$submoduleName" }
|
||||
@{ SubModulePath = "./$submoduleName\$submoduleName" }
|
||||
@{ SubModulePath = "./$submoduleName/$submoduleFileName" }
|
||||
@{ SubModulePath = "./$submoduleName\$submoduleFileName" }
|
||||
$testCases = @(
|
||||
@{ SubModulePath = "$submoduleName" }
|
||||
@{ SubModulePath = "$submoduleName\$submoduleName" }
|
||||
@{ SubModulePath = "$submoduleName/$submoduleName" }
|
||||
@{ SubModulePath = "$submoduleName\$submoduleFileName" }
|
||||
@{ SubModulePath = "$submoduleName/$submoduleFileName" }
|
||||
@{ SubModulePath = ".\$submoduleName" }
|
||||
@{ SubModulePath = ".\$submoduleName\$submoduleName" }
|
||||
@{ SubModulePath = ".\$submoduleName/$submoduleName" }
|
||||
@{ SubModulePath = ".\$submoduleName\$submoduleFileName" }
|
||||
@{ SubModulePath = ".\$submoduleName/$submoduleFileName" }
|
||||
@{ SubModulePath = "./$submoduleName" }
|
||||
@{ SubModulePath = "./$submoduleName/$submoduleName" }
|
||||
@{ SubModulePath = "./$submoduleName\$submoduleName" }
|
||||
@{ SubModulePath = "./$submoduleName/$submoduleFileName" }
|
||||
@{ SubModulePath = "./$submoduleName\$submoduleFileName" }
|
||||
)
|
||||
|
||||
It "Test if NestedModule path is <SubModulePath>" -TestCases $testCases {
|
||||
It "Test if NestedModule path is <SubModulePath>" -TestCases $testCases {
|
||||
param($SubModulePath)
|
||||
|
||||
New-ModuleManifest $moduleFilePath -NestedModules @($SubModulePath)
|
||||
@@ -44,7 +44,7 @@
|
||||
(Get-Module $moduleName).ExportedCommands.Keys.Contains('TestModuleFunction') | Should Be $true
|
||||
}
|
||||
|
||||
It "Test if RootModule path is <SubModulePath>" -TestCases $testCases {
|
||||
It "Test if RootModule path is <SubModulePath>" -TestCases $testCases {
|
||||
param($SubModulePath)
|
||||
|
||||
New-ModuleManifest $moduleFilePath -RootModule $SubModulePath
|
||||
|
||||
Reference in New Issue
Block a user