MCPcopy Create free account
hub / github.com/github/gh-aw / TestIsValid

Function TestIsValid

pkg/semverutil/semverutil_test.go:59–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestIsValid(t *testing.T) {
60 tests := []struct {
61 ref string
62 want bool
63 }{
64 {"v1.0.0", true},
65 {"1.0.0", true},
66 {"v1.0", true},
67 {"v1", true},
68 {"v1.0.0-beta", true},
69 {"v1.0.0+20230101", true},
70 {"main", false},
71 {"feature-branch", false},
72 {"abc123def456", false},
73 }
74 for _, tt := range tests {
75 t.Run(tt.ref, func(t *testing.T) {
76 got := IsValid(tt.ref)
77 if got != tt.want {
78 t.Errorf("IsValid(%q) = %v, want %v", tt.ref, got, tt.want)
79 }
80 })
81 }
82}
83
84func TestParseVersion(t *testing.T) {
85 tests := []struct {

Callers

nothing calls this directly

Calls 3

IsValidFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected