Skip to content

Commit

Permalink
copy_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgo committed Jul 29, 2022
1 parent 7e73ee1 commit 7c81b7f
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cmd/dev/headers/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}

Expand Down

0 comments on commit 7c81b7f

Please sign in to comment.