From e60f915e0b881eb336ec543dfc8a2c2689435831 Mon Sep 17 00:00:00 2001 From: aparnajyothi-y <147696841+aparnajyothi-y@users.noreply.github.com> Date: Fri, 28 Jun 2024 16:23:31 +0530 Subject: [PATCH] Update Go.Tests.ps1 --- tests/Go.Tests.ps1 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/Go.Tests.ps1 b/tests/Go.Tests.ps1 index e073a15..cf466bf 100644 --- a/tests/Go.Tests.ps1 +++ b/tests/Go.Tests.ps1 @@ -24,14 +24,15 @@ Describe "Go" { } It "version is correct" { - [version]$Version = $env:VERSION - $versionOutput = (Invoke-Expression -Command "go version") -split " " | Select-Object -Index 2 -replace "go", "" - $finalVersion = $Version.ToString(3) - If ($Version.Build -eq "0"){ - $finalVersion = $Version.ToString(2) + [version]$Version = $env:VERSION + $versionOutput = Invoke-Expression -Command "go version" + $finalVersion = $Version.ToString(3) + If ($Version.Build -eq "0"){ + $finalVersion = $Version.ToString(2) + } + $versionOutput | Should -Match $finalVersion } - $versionOutput | Should -Match $finalVersion -} + It "is used from tool-cache" { $goPath = (Get-Command "go").Path