(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func 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 | |
| 58 | func TestRefToFileName(t *testing.T) { |
| 59 | tests := []struct { |
nothing calls this directly
no test coverage detected