MCPcopy Create free account
hub / github.com/antonmedv/gitmal / TestParseFileModeInvalid

Function TestParseFileModeInvalid

pkg/git/utils_test.go:34–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestParseFileModeInvalid(t *testing.T) {
35 tests := []string{
36 "",
37 "12",
38 "abc",
39 "10070x",
40 }
41
42 for _, mode := range tests {
43 t.Run(mode, func(t *testing.T) {
44 result, err := git.ParseFileMode(mode)
45 if err == nil {
46 t.Error("expected error, got nil")
47 }
48 if result != "" {
49 t.Errorf("expected empty result, got %q", result)
50 }
51 if !strings.Contains(err.Error(), "invalid mode") && !strings.Contains(err.Error(), "strconv.Atoi") {
52 t.Errorf("unexpected error message: %v", err)
53 }
54 })
55 }
56}
57
58func TestRefToFileName(t *testing.T) {
59 tests := []struct {

Callers

nothing calls this directly

Calls 3

ParseFileModeFunction · 0.92
ErrorfMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected