This commit is contained in:
Nikita Bykov
2020-10-19 10:14:08 +03:00
30 changed files with 485 additions and 204 deletions

View File

@@ -3,12 +3,18 @@ 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
$ghcDefaultCases = @{
defaultGhcVersion = $defaultGhcVersion
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"
ghcShortVersion = $ghcShortVersion
binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcShortVersion\bin\ghc.exe"
}
}
@@ -17,11 +23,11 @@ Describe "Haskell" {
}
It "GHC <ghcVersion> is installed" -TestCases $ghcTestCases {
"$binGhcPath --version" | Should -MatchCommandOutput $ghcVersion
"$binGhcPath --version" | Should -MatchCommandOutput $ghcShortVersion
}
It "GHC <defaultGhcVersion> is the default version and should be the latest installed" -TestCases @{defaultGhcVersion = $defaultGhcVersion} {
"ghc --version" | Should -MatchCommandOutput $defaultGhcVersion
It "GHC <defaultGhcVersion> is the default version and should be the latest installed" -TestCases $ghcDefaultCases {
"ghc --version" | Should -MatchCommandOutput $defaultGhcShortVersion
}
It "Cabal is installed" {