Skip to content

Commit

Permalink
Setup testdata for symlink before testing, Fix otiai10#11
Browse files Browse the repository at this point in the history
  • Loading branch information
otiai10 committed Mar 20, 2019
1 parent a15b9cb commit c738103
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 12 additions & 2 deletions all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@ import (
)

func TestMain(m *testing.M) {
os.MkdirAll("testdata.copy", os.ModePerm)
setup(m)
code := m.Run()
os.RemoveAll("testdata.copy")
teardown(m)
os.Exit(code)
}

func setup(m *testing.M) {
os.MkdirAll("testdata.copy", os.ModePerm)
os.Symlink("testdata/case01", "testdata/case03/case01")
}

func teardown(m *testing.M) {
os.RemoveAll("testdata/case03/case01")
os.RemoveAll("testdata.copy")
}

func TestCopy(t *testing.T) {

err := Copy("./testdata/case00", "./testdata.copy/case00")
Expand Down
1 change: 0 additions & 1 deletion testdata/case03/case01

This file was deleted.

0 comments on commit c738103

Please sign in to comment.