mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
Migration to Pester tests
This commit is contained in:
33
images/win/scripts/Tests/Haskell.Tests.ps1
Normal file
33
images/win/scripts/Tests/Haskell.Tests.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
Describe "Haskell" {
|
||||
It "ghc" {
|
||||
"ghc --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "cabal" {
|
||||
"cabal --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
$chocoPackagesPath = Join-Path $env:ChocolateyInstall "lib"
|
||||
[array]$ghcVersionList = Get-ChildItem -Path $chocoPackagesPath -Filter "ghc.*" | ForEach-Object { $_.Name.TrimStart("ghc.") }
|
||||
$ghcCount = $ghcVersionList.Count
|
||||
|
||||
It "Accurate 3 versions of GHC are installed" -TestCases @{ghcCount = $ghcCount} {
|
||||
$ghcCount | Should -BeExactly 3
|
||||
}
|
||||
|
||||
$ghcTestCases = $ghcVersionList | ForEach-Object {
|
||||
@{
|
||||
ghcVersion = $_
|
||||
}
|
||||
}
|
||||
|
||||
It "Validation each of GHC version" -TestCases $ghcTestCases {
|
||||
$binGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$ghcVersion\tools\ghc-$ghcVersion\bin\ghc.exe"
|
||||
& $binGhcPath --version | Should -Match $ghcVersion
|
||||
}
|
||||
|
||||
It "Default version of GHC should be the latest installed" {
|
||||
$defaultGhcVersion = $ghcVersionList | Sort-Object {[Version]$_} |Select-Object -Last 1
|
||||
ghc --version | Should -Match $defaultGhcVersion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user