MCPcopy Index your code
hub / github.com/cli/cli / Test_dirEntry_isExecutable

Function Test_dirEntry_isExecutable

pkg/cmd/repo/read-dir/read_dir_test.go:57–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func 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
75func Test_dirEntry_modeOctal(t *testing.T) {
76 tests := []struct {

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
isExecutableMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected