diff --git a/gjson_test.go b/gjson_test.go index eba498f..24369fd 100644 --- a/gjson_test.go +++ b/gjson_test.go @@ -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)