(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestParseFileMode(t *testing.T) { |
| 11 | tests := []struct { |
| 12 | mode string |
| 13 | expected string |
| 14 | }{ |
| 15 | {"100644", "rw-r--r--"}, |
| 16 | {"100755", "rwxr-xr-x"}, |
| 17 | {"100600", "rw-------"}, |
| 18 | {"100400", "r--------"}, |
| 19 | } |
| 20 | |
| 21 | for _, tt := range tests { |
| 22 | t.Run(tt.mode, func(t *testing.T) { |
| 23 | result, err := git.ParseFileMode(tt.mode) |
| 24 | if err != nil { |
| 25 | t.Errorf("unexpected error: %v", err) |
| 26 | } |
| 27 | if result != tt.expected { |
| 28 | t.Errorf("got %q, want %q", result, tt.expected) |
| 29 | } |
| 30 | }) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func TestParseFileModeInvalid(t *testing.T) { |
| 35 | tests := []string{ |
nothing calls this directly
no test coverage detected