(t *testing.T)
| 56 | } |
| 57 | |
| 58 | func TestRefToFileName(t *testing.T) { |
| 59 | tests := []struct { |
| 60 | in string |
| 61 | want string |
| 62 | }{ |
| 63 | {"main", "main"}, |
| 64 | {"master", "master"}, |
| 65 | {"release/v1.0", "release-v1.0"}, |
| 66 | {"feature/add-login", "feature-add-login"}, |
| 67 | {"bugfix\\windows\\path", "bugfix-windows-path"}, |
| 68 | {"1.0.0", "1.0.0"}, |
| 69 | {"1.x", "1.x"}, |
| 70 | } |
| 71 | |
| 72 | for _, tt := range tests { |
| 73 | t.Run(tt.in, func(t *testing.T) { |
| 74 | got := git.RefToFileName(tt.in) |
| 75 | if got != tt.want { |
| 76 | t.Fatalf("refToFileName(%q) = %q, want %q", tt.in, got, tt.want) |
| 77 | } |
| 78 | }) |
| 79 | } |
| 80 | } |
nothing calls this directly
no test coverage detected