Adjusted test

This commit is contained in:
tidwall 2020-11-04 16:01:22 -07:00
parent 71341b2042
commit 2f043b7abd
1 changed files with 10 additions and 9 deletions

View File

@ -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)