(t *testing.T)
| 267 | } |
| 268 | |
| 269 | func TestStagingDirectoryNames(t *testing.T) { |
| 270 | var tests = []struct { |
| 271 | source string |
| 272 | branch string |
| 273 | sha string |
| 274 | expected string |
| 275 | }{ |
| 276 | {"source", "branch", "sha", "source-branch-sha"}, |
| 277 | {"source", "branch", "shortenedSha", "source-branch-shorten"}, |
| 278 | {"source", "duplicate", "duplicate", "source-duplicate"}, |
| 279 | {"source", "refs/tags/version", "sha", "source-version-sha"}, |
| 280 | {"source", "refs/tags/version", "shortenedSha", "source-version-shorten"}, |
| 281 | {"source", "refs/tags/version", "refs/tags/version", "source-version"}, |
| 282 | } |
| 283 | |
| 284 | for _, tt := range tests { |
| 285 | tt := tt // Account for scopelint checks |
| 286 | t.Run(tt.expected, func(t *testing.T) { |
| 287 | result := NameStagingDirectory(tt.source, tt.branch, tt.sha) |
| 288 | if result != tt.expected { |
| 289 | t.Errorf("got %s, want %s", result, tt.expected) |
| 290 | } |
| 291 | }) |
| 292 | } |
| 293 | } |
nothing calls this directly
no test coverage detected