[Ubuntu] Migrate tests for Haskell to Pester (#2314)

* Add Pester tests for Haskell on Ubuntu

* Add tests for all installed ghc versions

* Minor fix

* Minor fix

* Fix number of installed ghc versions test

* Fix GHC number test
This commit is contained in:
Vladimir Safonkin
2020-12-24 12:36:37 +03:00
committed by GitHub
parent 7f1a7b4177
commit ee8132a978
2 changed files with 34 additions and 21 deletions

View File

@@ -0,0 +1,31 @@
Describe "Haskell" {
$GHCCommonPath = "/opt/ghc"
$GHCVersions = Get-ChildItem -Path $GHCCommonPath | Where-Object { $_.Name -match "\d+\.\d+" }
$testCase = @{ GHCVersions = $GHCVersions }
It "GHC directory contains three version of GHC" -TestCases $testCase {
param ([object] $GHCVersions)
$GHCVersions.Count | Should -Be 3
}
$testCases = $GHCVersions | ForEach-Object { @{ GHCPath = "${_}/bin/ghc"} }
It "GHC version <GHCPath>" -TestCases $testCases {
param ([string] $GHCPath)
"$GHCPath --version" | Should -ReturnZeroExitCode
}
It "Default GHC" {
"ghc --version" | Should -ReturnZeroExitCode
}
It "Cabal" {
"cabal --version" | Should -ReturnZeroExitCode
}
It "Stack" {
"stack --version" | Should -ReturnZeroExitCode
}
}