From cb563be347a0aa8cfb384d8fd18a35b182be9c17 Mon Sep 17 00:00:00 2001 From: attiasas Date: Tue, 26 Sep 2023 14:08:18 +0300 Subject: [PATCH] fix for windows --- xray/utils/sarifutils_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xray/utils/sarifutils_test.go b/xray/utils/sarifutils_test.go index eefcd6289..1ffca65dc 100644 --- a/xray/utils/sarifutils_test.go +++ b/xray/utils/sarifutils_test.go @@ -1,6 +1,7 @@ package utils import ( + "path" "testing" "github.com/owenrumney/go-sarif/v2/sarif" @@ -301,22 +302,22 @@ func TestGetFullLocationFileName(t *testing.T) { expectedOutput string }{ { - file: "root/someDir/another/file", + file: path.Join("root","someDir","another","file"), invocations: []*sarif.Invocation{}, - expectedOutput: "root/someDir/another/file", + expectedOutput: path.Join("root","someDir","another","file"), }, { - file: "/another/file", + file: path.Join("another","file"), invocations: []*sarif.Invocation{ - {WorkingDirectory: sarif.NewSimpleArtifactLocation("/root/someDir/")}, - {WorkingDirectory: sarif.NewSimpleArtifactLocation("/not/relevant")}, + {WorkingDirectory: sarif.NewSimpleArtifactLocation(path.Join("root","someDir"))}, + {WorkingDirectory: sarif.NewSimpleArtifactLocation(path.Join("not","relevant"))}, }, - expectedOutput: "/root/someDir/another/file", + expectedOutput: path.Join("root","someDir","another","file"), }, { file: "another/file", - invocations: []*sarif.Invocation{{WorkingDirectory: sarif.NewSimpleArtifactLocation("/root/someDir")}}, - expectedOutput: "/root/someDir/another/file", + invocations: []*sarif.Invocation{{WorkingDirectory: sarif.NewSimpleArtifactLocation(path.Join("root","someDir"))}}, + expectedOutput: path.Join("root","someDir","another","file"), }, }