Update Go.Tests.ps1
This commit is contained in:
parent
e60f915e0b
commit
de2c2ba36e
|
@ -24,14 +24,18 @@ 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"
|
||||||
$finalVersion = $Version.ToString(3)
|
|
||||||
If ($Version.Build -eq "0"){
|
# Extract only the version number from the go version command output.
|
||||||
$finalVersion = $Version.ToString(2)
|
$installedVersion = ($versionOutput -split " ")[2] -replace "go", "" -replace "v", ""
|
||||||
}
|
|
||||||
$versionOutput | Should -Match $finalVersion
|
$finalVersion = $Version.ToString(3)
|
||||||
|
If ($Version.Build -eq "0"){
|
||||||
|
$finalVersion = $Version.ToString(2)
|
||||||
}
|
}
|
||||||
|
$installedVersion | Should -Match $finalVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
It "is used from tool-cache" {
|
It "is used from tool-cache" {
|
||||||
|
|
Loading…
Reference in New Issue