Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,16 @@ private Hashtable LoadModuleManifestData(
/// <summary>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vexx32, test results were not published for PowerShell-CI-linux at vstfs:///Build/Build/25574

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vexx32, your last commit had 23 failures in PowerShell-CI-macos
(These are 5 of the failures)

float/double precision when converting to string.[double]-to-[string] conversion in PowerShell should use the precision specifier G15

Expected strings to be the same, but they were different.
Expected length: 3
Actual length:   18
Strings differ at index 3.
Expected: '3.3'
But was:  '3.3000000000000003'
at <ScriptBlock>, /Users/vsts/agent/2.153.2/work/1/s/test/powershell/Language/Parser/Conversions.Tests.ps1: line 540
540:         $value -as [string] | Should -BeExactly $StringConversionResult

float/double precision when converting to string.[double]-to-[string] conversion in PowerShell should use the precision specifier G15

Expected strings to be the same, but they were different.
Expected length: 3
Actual length:   18
Strings differ at index 3.
Expected: '6.6'
But was:  '6.6000000000000005'
at <ScriptBlock>, /Users/vsts/agent/2.153.2/work/1/s/test/powershell/Language/Parser/Conversions.Tests.ps1: line 540
540:         $value -as [string] | Should -BeExactly $StringConversionResult

float/double precision when converting to string.[double]-to-[string] conversion in PowerShell should use the precision specifier G15

Expected strings to be the same, but they were different.
Expected length: 16
Actual length:   17
Strings differ at index 15.
Expected: '2.71828182845905'
But was:  '2.718281828459045'
at <ScriptBlock>, /Users/vsts/agent/2.153.2/work/1/s/test/powershell/Language/Parser/Conversions.Tests.ps1: line 540
540:         $value -as [string] | Should -BeExactly $StringConversionResult

float/double precision when converting to string.[double]-to-[string] conversion in PowerShell should use the precision specifier G15

Expected strings to be the same, but they were different.
Expected length: 16
Actual length:   17
Strings differ at index 16.
Expected: '3.14159265358979'
But was:  '3.141592653589793'
at <ScriptBlock>, /Users/vsts/agent/2.153.2/work/1/s/test/powershell/Language/Parser/Conversions.Tests.ps1: line 540
540:         $value -as [string] | Should -BeExactly $StringConversionResult

float/double precision when converting to string.[float]-to-[string] conversion in PowerShell should use the precision specifier G7

Expected strings to be the same, but they were different.
Expected length: 3
Actual length:   9
Strings differ at index 3.
Expected: '3.3'
But was:  '3.3000002'
at <ScriptBlock>, /Users/vsts/agent/2.153.2/work/1/s/test/powershell/Language/Parser/Conversions.Tests.ps1: line 540
540:         $value -as [string] | Should -BeExactly $StringConversionResult

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vexx32, test results were not published for PowerShell-CI-static-analysis at vstfs:///Build/Build/25572

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vexx32, test results were not published for PowerShell-CI-windows at vstfs:///Build/Build/25575

/// Extra variables that are allowed to be referenced in module manifest file.
/// </summary>
private static readonly string[] s_extraAllowedVariables = new string[] { SpecialVariables.PSScriptRoot, SpecialVariables.PSEdition, SpecialVariables.EnabledExperimentalFeatures };
private static readonly string[] s_extraAllowedVariables = new string[] {
SpecialVariables.EnabledExperimentalFeatures,
SpecialVariables.Home,
SpecialVariables.IsLinux,
SpecialVariables.IsMacOS,
SpecialVariables.IsWindows,
SpecialVariables.PSEdition,
SpecialVariables.PSHome,
SpecialVariables.PSScriptRoot
};

/// <summary>
/// Load and execute the manifest psd1 file or a localized manifest psd1 file.
Expand Down
32 changes: 32 additions & 0 deletions test/powershell/engine/Module/TestModuleManifest.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,38 @@ Describe "Test-ModuleManifest tests" -tags "CI" {
$module.NestedModules | Should -HaveCount 1
$module.NestedModules.Name | Should -BeExactly "Foo"
}

It "module manifest containing some Special Variables are allowed" {

Set-Content -Path $testModulePath -Value @'
@{
ModuleVersion = "1.2.3"
PrivateData = @{
EnabledExperimentalFeatures = "$EnabledExperimentalFeatures"
Home = "$Home"
IsLinux = "$IsLinux"
IsMacOS = "$IsMacOS"
IsWindows = "$IsWindows"
PSCulture = "$PSCulture"
PSUICulture = "$PSUICulture"
PSEdition = "$PSEdition"
PSHome = "$PSHome"
PSScriptRoot = "$PSScriptRoot"
}
}
'@
$module = Test-ModuleManifest -Path $testModulePath
$module.PrivateData.EnabledExperimentalFeatures | Should -BeExactly "$EnabledExperimentalFeatures"
$module.PrivateData.Home | Should -Not -BeNullOrEmpty
$module.PrivateData.IsLinux | Should -BeExactly "$IsLinux"
$module.PrivateData.IsMacOS | Should -BeExactly "$IsMacOS"
$module.PrivateData.IsWindows | Should -BeExactly "$IsWindows"
$module.PrivateData.PSCulture | Should -BeExactly "$PSCulture"
$module.PrivateData.PSUICulture | Should -BeExactly "$PSUICulture"
$module.PrivateData.PSEdition | Should -BeExactly "$PSEdition"
$module.PrivateData.PSHome | Should -Not -BeNullOrEmpty
$module.PrivateData.PSScriptRoot | Should -Not -BeNullOrEmpty
}
}

Describe "Tests for circular references in required modules" -tags "CI" {
Expand Down