Skip to content

Commit

Permalink
edit test
Browse files Browse the repository at this point in the history
  • Loading branch information
v_ljtli committed May 15, 2023
1 parent 1a18a01 commit 90b3015
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"math"
"os"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -5579,10 +5580,11 @@ func TestOneOfValidation(t *testing.T) {
errs := validate.Var(spec.f, spec.t)
AssertError(t, errs, "", "", "", "", "oneof")
}

f := 3.14
_, frac := math.Modf(f)
PanicMatches(t, func() {
_ = validate.Var(3.14, "oneof=red green")
}, "Bad field type float64")
_ = validate.Var(f, "oneof=red green")
}, fmt.Sprintf("The float %v has a fractional part of %v.\n", f, frac))
}

func TestBase64Validation(t *testing.T) {
Expand Down

0 comments on commit 90b3015

Please sign in to comment.