diff --git a/rule/max_bound_test.go b/rule/max_bound_test.go index dd6786c..c050f84 100644 --- a/rule/max_bound_test.go +++ b/rule/max_bound_test.go @@ -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) + } +} diff --git a/rule/min_bound_test.go b/rule/min_bound_test.go index 3ec6325..9781f01 100644 --- a/rule/min_bound_test.go +++ b/rule/min_bound_test.go @@ -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) + } +}