mirror of
https://github.com/actions/go-versions
synced 2024-11-24 20:22:40 +00:00
Update Go.Tests.ps1
This commit is contained in:
parent
e60f915e0b
commit
de2c2ba36e
1 changed files with 11 additions and 7 deletions
|
@ -26,11 +26,15 @@ Describe "Go" {
|
||||||
It "version is correct" {
|
It "version is correct" {
|
||||||
[version]$Version = $env:VERSION
|
[version]$Version = $env:VERSION
|
||||||
$versionOutput = Invoke-Expression -Command "go version"
|
$versionOutput = Invoke-Expression -Command "go version"
|
||||||
|
|
||||||
|
# Extract only the version number from the go version command output.
|
||||||
|
$installedVersion = ($versionOutput -split " ")[2] -replace "go", "" -replace "v", ""
|
||||||
|
|
||||||
$finalVersion = $Version.ToString(3)
|
$finalVersion = $Version.ToString(3)
|
||||||
If ($Version.Build -eq "0"){
|
If ($Version.Build -eq "0"){
|
||||||
$finalVersion = $Version.ToString(2)
|
$finalVersion = $Version.ToString(2)
|
||||||
}
|
}
|
||||||
$versionOutput | Should -Match $finalVersion
|
$installedVersion | Should -Match $finalVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue