Skip to content

Commit a40ed24

Browse files
AMaini503Aayush Maini
andauthored
Fix go detector UT (#1429)
Co-authored-by: Aayush Maini <aamaini@microsoft.com>
1 parent 08a12e3 commit a40ed24

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/Microsoft.ComponentDetection.Detectors.Tests/GoComponentDetectorTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ public async Task TestGoDetector_GoGraphReplaceWithRelativePathAsync()
592592
var localPath = OperatingSystem.IsWindows()
593593
? "C:/test/module/"
594594
: "/home/test/module/";
595-
var goMod = @"module example.com/project
595+
var goMod = $@"module example.com/project
596596
597597
go 1.11
598598
@@ -603,10 +603,9 @@ other v1.2.0 // indirect
603603
a v1.5.0 // indirect
604604
)
605605
606-
replace a v1.5.0 => {LOCAL_MODULE_PATH}
606+
replace a v1.5.0 => {localPath}
607607
";
608608

609-
goMod = goMod.Replace("{LOCAL_MODULE_PATH", localPath);
610609
var goGraph = "example.com/mainModule some-package@v1.2.3\nsome-package@v1.2.3 other@v1.0.0\nsome-package@v1.2.3 other@v1.2.0\ntest@v2.0.0 a@v1.5.0";
611610
string[] cmdParams = [];
612611
this.commandLineMock.Setup(x => x.CanCommandBeLocatedAsync("go", null, It.IsAny<DirectoryInfo>(), cmdParams))

0 commit comments

Comments
 (0)