Skip to content

Commit

Permalink
Added a condition for the $binGhcPath to not depend on the exact Hask…
Browse files Browse the repository at this point in the history
…ell version (actions#3537)
  • Loading branch information
miketimofeev authored Jun 7, 2021
1 parent 638ad60 commit 395eb43
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions images/win/scripts/Tests/Haskell.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Describe "Haskell" {
$ghcVersion = $_
$ghcShortVersion = ([version]$ghcVersion).ToString(3)
$binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcShortVersion\bin\ghc.exe"
# Starting from version 9 haskell installation directory is $env:ChocolateyToolsLocation instead of $env:ChocolateyInstall\lib
if ($ghcVersion -notmatch "^[0-8]\.\d+.*")
# The most recent GHC versions installation directory is $env:ChocolateyToolsLocation instead of $env:ChocolateyInstall\lib
if (-not (Test-Path $binGhcPath))
{
$binGhcPath = Join-Path $env:ChocolateyToolsLocation "ghc-$ghcShortVersion\bin\ghc.exe"
}
Expand All @@ -36,11 +36,6 @@ Describe "Haskell" {
"ghc --version" | Should -MatchCommandOutput $defaultGhcShortVersion
}

# Sometimes choco doesn't return version 9, need to check it explicitly https://github.com/chocolatey/choco/issues/2271
It "Default GHC version is 9" -TestCases $ghcDefaultCases {
"ghc --version" | Should -MatchCommandOutput "9(\.\d+){2,}"
}

It "Cabal is installed" {
"cabal --version" | Should -ReturnZeroExitCode
}
Expand Down

0 comments on commit 395eb43

Please sign in to comment.