Skip to content

Commit

Permalink
Merge pull request #21 from tenntenn/set-helper
Browse files Browse the repository at this point in the history
isJSON is test helper
  • Loading branch information
k1LoW authored Mar 4, 2024
2 parents 91b6670 + 88f8cef commit 6ffc072
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ func (c *Checker) Check(suffix string, data any) (diff string) {
}

func (c *Checker) isJSON(s string) bool {
c.testingT.Helper()

var v any
err := json.NewDecoder(strings.NewReader(s)).Decode(&v)

Expand All @@ -122,6 +124,7 @@ func (c *Checker) isJSON(s string) bool {

func (c *Checker) isBytes(v any) bool {
c.testingT.Helper()

_, ok := v.([]byte)
return ok
}
Expand Down

0 comments on commit 6ffc072

Please sign in to comment.