Skip to content

Commit

Permalink
✅ fix tests: internal/version
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
  • Loading branch information
rinx committed Aug 27, 2020
1 parent 36025e0 commit c328e20
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package version

import (
"fmt"
"testing"

"github.com/vdaas/vald/internal/errors"
Expand Down Expand Up @@ -52,7 +53,7 @@ func TestCheck(t *testing.T) {
max: "1.0.10",
min: "1.0.0",
},
want: errors.New("Malformed version: vald"),
want: fmt.Errorf("Malformed version: vald"),
},

{
Expand All @@ -62,7 +63,7 @@ func TestCheck(t *testing.T) {
max: "vald",
min: "1.0.0",
},
want: errors.New("Malformed constraint: <= vald"),
want: fmt.Errorf("Malformed constraint: <= vald"),
},

{
Expand All @@ -79,8 +80,8 @@ func TestCheck(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := Check(tt.args.cur, tt.args.max, tt.args.min)
if !errors.Is(tt.want, err) {
t.Error(err)
if !errors.Is(err, tt.want) {
t.Errorf("got: %s, want: %s", err, tt.want)
}
})
}
Expand Down

0 comments on commit c328e20

Please sign in to comment.