From 2f043b7abd545e132b19ad617eec614001b20f64 Mon Sep 17 00:00:00 2001 From: tidwall Date: Wed, 4 Nov 2020 16:01:22 -0700 Subject: [PATCH] Adjusted test --- gjson_test.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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)