added extra test

This commit is contained in:
Josh Baker 2016-08-31 13:38:53 -07:00
parent 3e35b37021
commit b7e578ec72
1 changed files with 7 additions and 1 deletions

View File

@ -119,7 +119,8 @@ var basicJSON = `{"age":100, "name":{"here":"B\\\"R"},
"email": "cccc" "email": "cccc"
}, },
{ {
"firstName": 1002.3 "firstName": 1002.3,
"age": 101
} }
] ]
} }
@ -128,6 +129,11 @@ var basicJSON = `{"age":100, "name":{"here":"B\\\"R"},
func TestBasic(t *testing.T) { func TestBasic(t *testing.T) {
var mtok Result var mtok Result
mtok = Get(basicJSON, `loggy.programmers.#[age=101].firstName`)
if mtok.String() != "1002.3" {
t.Fatalf("expected %v, got %v", "1002,3", mtok.String())
}
mtok = Get(basicJSON, `loggy.programmers.#[firstName == "Brett"].email`) mtok = Get(basicJSON, `loggy.programmers.#[firstName == "Brett"].email`)
if mtok.String() != "aaaa" { if mtok.String() != "aaaa" {
t.Fatalf("expected %v, got %v", "aaaa", mtok.String()) t.Fatalf("expected %v, got %v", "aaaa", mtok.String())