MCPcopy
hub / github.com/kptdev/kpt / TestStagingDirectoryNames

Function TestStagingDirectoryNames

internal/util/diff/diff_test.go:269–293  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

267}
268
269func 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}

Callers

nothing calls this directly

Calls 2

NameStagingDirectoryFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected