MCPcopy Create free account
hub / github.com/antonmedv/gitmal / TestRefToFileName

Function TestRefToFileName

pkg/git/utils_test.go:58–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func 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}

Callers

nothing calls this directly

Calls 1

RefToFileNameFunction · 0.92

Tested by

no test coverage detected