@@ -111,16 +111,16 @@ func TestExecPipesDataToExternalCommandAndGetsExpectedOutput(t *testing.T) {
111
111
func TestFindFiles_DoesNotErrorWhenSubDirectoryIsNotReadable (t * testing.T ) {
112
112
t .Parallel ()
113
113
tmpDir := t .TempDir ()
114
- fileAPath := filepath .Join (tmpDir , "file_a.txt " )
115
- if err := os .WriteFile ( fileAPath , [] byte ( "hello world!" ) , os .ModePerm ); err != nil {
114
+ restrictedDirPath := filepath .Join (tmpDir , "a_restricted_dir " )
115
+ if err := os .Mkdir ( restrictedDirPath , os .ModePerm ); err != nil {
116
116
t .Fatal (err )
117
117
}
118
- restrictedDirPath := filepath .Join (tmpDir , "restricted_dir " )
119
- if err := os .Mkdir ( restrictedDirPath , os .ModePerm ); err != nil {
118
+ fileAPath := filepath .Join (restrictedDirPath , "file_a.txt " )
119
+ if err := os .WriteFile ( fileAPath , [] byte ( "hello again!" ) , os .ModePerm ); err != nil {
120
120
t .Fatal (err )
121
121
}
122
- fileBPath := filepath .Join (restrictedDirPath , "file_b.txt" )
123
- if err := os .WriteFile (fileBPath , []byte ("hello again !" ), os .ModePerm ); err != nil {
122
+ fileBPath := filepath .Join (tmpDir , "file_b.txt" )
123
+ if err := os .WriteFile (fileBPath , []byte ("hello world !" ), os .ModePerm ); err != nil {
124
124
t .Fatal (err )
125
125
}
126
126
if err := os .Chmod (restrictedDirPath , 0o000 ); err != nil {
@@ -131,7 +131,7 @@ func TestFindFiles_DoesNotErrorWhenSubDirectoryIsNotReadable(t *testing.T) {
131
131
if err != nil {
132
132
t .Fatal (err )
133
133
}
134
- want := fileAPath + "\n "
134
+ want := fileBPath + "\n "
135
135
if err != nil {
136
136
t .Fatal (err )
137
137
}
0 commit comments