Skip to content

Commit

Permalink
Remove Unncessary File
Browse files Browse the repository at this point in the history
  • Loading branch information
mahadzaryab1 committed Nov 16, 2024
1 parent fa20e7a commit 0b74dea
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions script_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,18 @@ func TestFindFiles_DoesNotErrorWhenSubDirectoryIsNotReadable(t *testing.T) {
t.Parallel()
tmpDir := t.TempDir()
restrictedDirPath := filepath.Join(tmpDir, "a_restricted_dir")
if err := os.Mkdir(restrictedDirPath, os.ModePerm); err != nil {
if err := os.Mkdir(restrictedDirPath, 0o000); err != nil {
t.Fatal(err)
}
fileAPath := filepath.Join(restrictedDirPath, "file_a.txt")
if err := os.WriteFile(fileAPath, []byte("hello again!"), os.ModePerm); err != nil {
fileAPath := filepath.Join(tmpDir, "file_a.txt")
if err := os.WriteFile(fileAPath, []byte("hello world!"), os.ModePerm); err != nil {
t.Fatal(err)
}
fileBPath := filepath.Join(tmpDir, "file_b.txt")
if err := os.WriteFile(fileBPath, []byte("hello world!"), os.ModePerm); err != nil {
t.Fatal(err)
}
if err := os.Chmod(restrictedDirPath, 0o000); err != nil {
t.Fatal(err)
}
t.Cleanup(func() { os.Chmod(restrictedDirPath, os.ModePerm) })
got, err := script.FindFiles(tmpDir).String()
if err != nil {
t.Fatal(err)
}
want := fileBPath + "\n"
want := fileAPath + "\n"
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 0b74dea

Please sign in to comment.