diff --git a/images/win/scripts/Tests/Haskell.Tests.ps1 b/images/win/scripts/Tests/Haskell.Tests.ps1 index b6ebb763..53a0bf6c 100644 --- a/images/win/scripts/Tests/Haskell.Tests.ps1 +++ b/images/win/scripts/Tests/Haskell.Tests.ps1 @@ -3,12 +3,14 @@ Describe "Haskell" { [array]$ghcVersionList = Get-ChildItem -Path $chocoPackagesPath -Filter "ghc.*" | ForEach-Object { $_.Name.TrimStart("ghc.") } $ghcCount = $ghcVersionList.Count $defaultGhcVersion = $ghcVersionList | Sort-Object {[Version]$_} | Select-Object -Last 1 + $defaultGhcShortVersion = ([version]$defaultGhcVersion).ToString(3) $ghcTestCases = $ghcVersionList | ForEach-Object { $ghcVersion = $_ + $ghcShortVersion = ([version]$ghcVersion).ToString(3) @{ - ghcVersion = $ghcVersion - binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcVersion\bin\ghc.exe" + ghcVersion = $ghcShortVersion + binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcShortVersion\bin\ghc.exe" } } @@ -20,7 +22,7 @@ Describe "Haskell" { "$binGhcPath --version" | Should -MatchCommandOutput $ghcVersion } - It "GHC is the default version and should be the latest installed" -TestCases @{defaultGhcVersion = $defaultGhcVersion} { + It "GHC is the default version and should be the latest installed" -TestCases @{defaultGhcVersion = $defaultGhcShortVersion} { "ghc --version" | Should -MatchCommandOutput $defaultGhcVersion }