From 395eb43c2bdc41bac61cbd0ad4dcdd8f80eb1506 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Mon, 7 Jun 2021 20:49:36 +0300 Subject: [PATCH] Added a condition for the $binGhcPath to not depend on the exact Haskell version (#3537) --- images/win/scripts/Tests/Haskell.Tests.ps1 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/images/win/scripts/Tests/Haskell.Tests.ps1 b/images/win/scripts/Tests/Haskell.Tests.ps1 index 903e95da2..854ba0310 100644 --- a/images/win/scripts/Tests/Haskell.Tests.ps1 +++ b/images/win/scripts/Tests/Haskell.Tests.ps1 @@ -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" } @@ -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 }