From 0f6d2a43929e4b1c9573030a94b8b4860ee010b8 Mon Sep 17 00:00:00 2001 From: aparnajyothi-y <147696841+aparnajyothi-y@users.noreply.github.com> Date: Fri, 28 Jun 2024 16:01:13 +0530 Subject: [PATCH] Update Go.Tests.ps1 --- tests/Go.Tests.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/Go.Tests.ps1 b/tests/Go.Tests.ps1 index aed1025..2cb0eb8 100644 --- a/tests/Go.Tests.ps1 +++ b/tests/Go.Tests.ps1 @@ -24,14 +24,14 @@ Describe "Go" { } It "version is correct" { - [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 + [version]$Version = $env:VERSION + $versionOutput = (Invoke-Expression -Command "go version") -replace "v", "" # remove "v" prefix + $finalVersion = $Version.ToString(3) + If ($Version.Build -eq "0") { + $finalVersion = $Version.ToString(2) } + $versionOutput | Should -Match $finalVersion +} It "is used from tool-cache" { $goPath = (Get-Command "go").Path