diff --git a/cmd/dev/headers/copy_test.go b/cmd/dev/headers/copy_test.go index 9aca9488..dd52c1fc 100644 --- a/cmd/dev/headers/copy_test.go +++ b/cmd/dev/headers/copy_test.go @@ -240,11 +240,9 @@ func (ws *workspace) verifyContent(t *testing.T, filepath, want string) { // the exact same way as the built-in "cp" command in Unix func (ws *workspace) verifySameBehaviorAsCp(t *testing.T, src, dstTemplate string) { t.Helper() - // run "cp" dstCp := strings.Replace(dstTemplate, "{{dstDir}}", ws.dstCp.Path, 1) _, err := exec.Command("cp", src, dstCp).CombinedOutput() assert.NoError(t, err) - // run "CopyFile" dstCopy := strings.Replace(dstTemplate, "{{dstDir}}", ws.dstCopy.Path, 1) err = CopyFile(src, dstCopy) assert.NoError(t, err) @@ -254,15 +252,12 @@ func (ws *workspace) verifySameBehaviorAsCp(t *testing.T, src, dstTemplate strin // ensures that the "CopyFiles" function copies files the exact same way as the built-in "cp -r" command in Unix. func (ws *workspace) verifySameBehaviorAsCpr(t *testing.T, src, dstTemplate string) { t.Helper() - // run "cp -r" dst := strings.Replace(dstTemplate, "{{dstDir}}", ws.dstCp.Path, 1) _, err := exec.Command("cp", "-rv", src, dst).CombinedOutput() assert.NoError(t, err) - // run "CopyFile" dst = strings.Replace(dstTemplate, "{{dstDir}}", ws.dstCopy.Path, 1) err = CopyFiles(src, dst) assert.NoError(t, err) - // verify that both created the same files and folders ws.verifyEqualDstStructure(t) }