forked from mirror/gjson
Adjusted test
This commit is contained in:
parent
71341b2042
commit
2f043b7abd
|
@ -313,16 +313,17 @@ func TestTypes(t *testing.T) {
|
||||||
assert(t, (Result{Type: JSON}).Type.String() == "JSON")
|
assert(t, (Result{Type: JSON}).Type.String() == "JSON")
|
||||||
assert(t, (Result{Type: 100}).Type.String() == "")
|
assert(t, (Result{Type: 100}).Type.String() == "")
|
||||||
// bool
|
// 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: False}).Bool() == false)
|
||||||
assert(t, (Result{Type: Number, Num: 1}).Bool())
|
assert(t, (Result{Type: Number, Num: 1}).Bool() == true)
|
||||||
assert(t, (Result{Type: String, Str: "1"}).Bool())
|
assert(t, (Result{Type: Number, Num: 0}).Bool() == false)
|
||||||
assert(t, (Result{Type: String, Str: "T"}).Bool())
|
assert(t, (Result{Type: String, Str: "1"}).Bool() == true)
|
||||||
assert(t, (Result{Type: String, Str: "t"}).Bool())
|
assert(t, (Result{Type: String, Str: "T"}).Bool() == true)
|
||||||
assert(t, (Result{Type: String, Str: "true"}).Bool())
|
assert(t, (Result{Type: String, Str: "t"}).Bool() == true)
|
||||||
assert(t, (Result{Type: String, Str: "True"}).Bool())
|
assert(t, (Result{Type: String, Str: "true"}).Bool() == true)
|
||||||
assert(t, (Result{Type: String, Str: "TRUE"}).Bool())
|
assert(t, (Result{Type: String, Str: "True"}).Bool() == true)
|
||||||
assert(t, (Result{Type: String, Str: "tRuE"}).Bool() == false)
|
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: "0"}).Bool() == false)
|
||||||
assert(t, (Result{Type: String, Str: "f"}).Bool() == false)
|
assert(t, (Result{Type: String, Str: "f"}).Bool() == false)
|
||||||
assert(t, (Result{Type: String, Str: "F"}).Bool() == false)
|
assert(t, (Result{Type: String, Str: "F"}).Bool() == false)
|
||||||
|
|
Loading…
Reference in New Issue