Skip to content

Commit

Permalink
test: TemplateName.String
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr committed Oct 12, 2024
1 parent b992874 commit 70b7039
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
7 changes: 0 additions & 7 deletions name.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ func checkPathValueNames(in []string) error {
}

func (tn TemplateName) String() string { return tn.name }
func (tn TemplateName) Pattern() string {
return tn.method + " " + tn.path
}

func (tn TemplateName) sameRoute(p TemplateName) bool {
return tn.endpoint == p.endpoint
}

func (tn TemplateName) byPathThenMethod(d TemplateName) int {
if n := cmp.Compare(tn.path, d.path); n != 0 {
Expand Down
3 changes: 2 additions & 1 deletion name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ func TestPattern_parseHandler(t *testing.T) {
},
} {
t.Run(tt.Name, func(t *testing.T) {
_, err, ok := muxt.NewTemplateName(tt.In)
tn, err, ok := muxt.NewTemplateName(tt.In)
if assert.Equal(t, tt.ExpMatch, ok) {
if tt.ExpErr != "" {
assert.ErrorContains(t, err, tt.ExpErr)
} else {
assert.Equal(t, tt.In, tn.String())
assert.NoError(t, err)
}
}
Expand Down

0 comments on commit 70b7039

Please sign in to comment.