Skip to content

Commit

Permalink
chore: improved tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guiferpa committed Jan 17, 2025
1 parent c8b00b0 commit 2bd0ea5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rule/max_bound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,12 @@ func TestMaxBoundWithInvalidParam(t *testing.T) {
}
}
}

func TestMaxBoundError(t *testing.T) {
err := &ErrMaxBound{Field: "text", Value: "2", Bound: 1}
got := err.Error()
want := "the value 2 in field text has character limit greater than 1"
if got != want {
t.Errorf(`&ErrMaxBound{Field: "text", Value: "2", Bound: 1}.Error(), got: %v, want: %v`, got, want)
}
}
9 changes: 9 additions & 0 deletions rule/min_bound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,12 @@ func TestMinBoundWithInvalidParam(t *testing.T) {
}
}
}

func TestMinBoundError(t *testing.T) {
err := &ErrMinBound{Field: "text", Value: "2", Bound: 1}
got := err.Error()
want := "the value 2 in field text has character limit less than 1"
if got != want {
t.Errorf(`&ErrMinBound{Field: "text", Value: "2", Bound: 1}.Error(), got: %v, want: %v`, got, want)
}
}

0 comments on commit 2bd0ea5

Please sign in to comment.