(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func Test_dirEntry_isExecutable(t *testing.T) { |
| 58 | tests := []struct { |
| 59 | name string |
| 60 | entry dirEntry |
| 61 | want bool |
| 62 | }{ |
| 63 | {name: "executable file", entry: dirEntry{Type: "file", Mode: 0o100755}, want: true}, |
| 64 | {name: "regular file", entry: dirEntry{Type: "file", Mode: 0o100644}, want: false}, |
| 65 | {name: "directory", entry: dirEntry{Type: "dir", Mode: 0o040000}, want: false}, |
| 66 | {name: "symlink", entry: dirEntry{Type: "symlink", Mode: 0o120000}, want: false}, |
| 67 | } |
| 68 | for _, tt := range tests { |
| 69 | t.Run(tt.name, func(t *testing.T) { |
| 70 | assert.Equal(t, tt.want, tt.entry.isExecutable()) |
| 71 | }) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | func Test_dirEntry_modeOctal(t *testing.T) { |
| 76 | tests := []struct { |
nothing calls this directly
no test coverage detected