Skip to content

Commit

Permalink
Adjusted test
Browse files Browse the repository at this point in the history
  • Loading branch information
tidwall committed Nov 4, 2020
1 parent 71341b2 commit 2f043b7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions gjson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,17 @@ func TestTypes(t *testing.T) {
assert(t, (Result{Type: JSON}).Type.String() == "JSON")
assert(t, (Result{Type: 100}).Type.String() == "")
// bool
assert(t, (Result{Type: True}).Bool())
assert(t, (Result{Type: True}).Bool() == true)
assert(t, (Result{Type: False}).Bool() == false)
assert(t, (Result{Type: Number, Num: 1}).Bool())
assert(t, (Result{Type: String, Str: "1"}).Bool())
assert(t, (Result{Type: String, Str: "T"}).Bool())
assert(t, (Result{Type: String, Str: "t"}).Bool())
assert(t, (Result{Type: String, Str: "true"}).Bool())
assert(t, (Result{Type: String, Str: "True"}).Bool())
assert(t, (Result{Type: String, Str: "TRUE"}).Bool())
assert(t, (Result{Type: String, Str: "tRuE"}).Bool() == false)
assert(t, (Result{Type: Number, Num: 1}).Bool() == true)
assert(t, (Result{Type: Number, Num: 0}).Bool() == false)
assert(t, (Result{Type: String, Str: "1"}).Bool() == true)
assert(t, (Result{Type: String, Str: "T"}).Bool() == true)
assert(t, (Result{Type: String, Str: "t"}).Bool() == true)
assert(t, (Result{Type: String, Str: "true"}).Bool() == true)
assert(t, (Result{Type: String, Str: "True"}).Bool() == true)
assert(t, (Result{Type: String, Str: "TRUE"}).Bool() == true)
assert(t, (Result{Type: String, Str: "tRuE"}).Bool() == true)
assert(t, (Result{Type: String, Str: "0"}).Bool() == false)
assert(t, (Result{Type: String, Str: "f"}).Bool() == false)
assert(t, (Result{Type: String, Str: "F"}).Bool() == false)
Expand Down

0 comments on commit 2f043b7

Please sign in to comment.