Update Go.Tests.ps1

This commit is contained in:
aparnajyothi-y 2024-06-28 16:23:31 +05:30 committed by GitHub
parent ba76e8ae2e
commit e60f915e0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 7 deletions

View File

@ -25,13 +25,14 @@ Describe "Go" {
It "version is correct" { It "version is correct" {
[version]$Version = $env:VERSION [version]$Version = $env:VERSION
$versionOutput = (Invoke-Expression -Command "go version") -split " " | Select-Object -Index 2 -replace "go", "" $versionOutput = Invoke-Expression -Command "go version"
$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 $versionOutput | Should -Match $finalVersion
} }
It "is used from tool-cache" { It "is used from tool-cache" {
$goPath = (Get-Command "go").Path $goPath = (Get-Command "go").Path