diff --git a/packages/core/install/gobinaries_test.go b/packages/core/install/gobinaries_test.go index fd6724a..079622e 100644 --- a/packages/core/install/gobinaries_test.go +++ b/packages/core/install/gobinaries_test.go @@ -172,6 +172,9 @@ func TestCopyFromSkipsAlreadyIdenticalBinary(t *testing.T) { } to := filepath.Join(BinDir(), name) + if err := os.Remove(to); err != nil { + t.Fatal(err) + } if err := os.Link(from, to); err != nil { t.Skipf("hard links unsupported here: %v", err) } @@ -186,6 +189,9 @@ func TestCopyFromSkipsAlreadyIdenticalBinary(t *testing.T) { if !found { t.Errorf("copyFrom() with a same-inode destination should still report %q as placed, got %v", name, placed) } + if !sameFile(from, to) { + t.Error("copyFrom() replaced a same-inode destination instead of skipping the copy") + } } func TestInstallGoBinariesCreatesBinDir(t *testing.T) {