Skip to content

Commit

Permalink
Changed to create an empty directory during testing. Because storing …
Browse files Browse the repository at this point in the history
….gitkeep changes the test results.
  • Loading branch information
nao1215 committed Sep 16, 2022
1 parent 259573c commit c9fe0cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ func Test_check_gobin_is_empty(t *testing.T) {
},
},
}

if err := os.Mkdir("./testdata/empty_dir", 0755); err != nil {
t.Fatal(err)
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
oldGoBin := os.Getenv("GOBIN")
Expand Down Expand Up @@ -216,6 +221,11 @@ func Test_check_gobin_is_empty(t *testing.T) {
}
})
}

err := os.Remove("./testdata/empty_dir")
if err != nil {
t.Fatal(err)
}
}

func Test_printUpdatablePkgInfo(t *testing.T) {
Expand Down
Empty file removed cmd/testdata/empty_dir/.gitkeep
Empty file.

0 comments on commit c9fe0cc

Please sign in to comment.