Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
seefan committed Mar 31, 2019
1 parent 7518f5d commit 5f0b391
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jsonvalue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (

func TestJsonValue_GetValue(t *testing.T) {
r := ParseJsonObject([]byte(" {\"data\" : {\"key\" : 123,\"abc\":-1021e5 } , \"value\":5 ,\"ars\":[1,2,3,4,{\"value\":5},\"6\",{\"value\":7}]}"))
t.Log(r.GetJsonObject("data").GetJsonValue("abc").String())
t.Log(r.GetObject("data").GetValue("abc"))

r.GetJsonArray("ars").each(func(i int, value JsonValue) {
r.GetArray("ars").Each(func(i int, value JsonValue) {
t.Log(i, value)
})
arr := ParseJsonArray([]byte("[{\"data\" : {\"key\" : 123,\"abc\":-1021e5 } , \"value\":5 ,\"ars\":[1,2,3,4,{\"value\":5},\"6\",{\"value\":7}]},0,1,\"sfdada\"]"))
arr.each(func(i int, value JsonValue) {
arr.Each(func(i int, value JsonValue) {
if i == 0 {
t.Log(value.JsonObject().GetJsonObject("data").GetJsonValue("key"))
t.Log(value.ParseJsonObject().GetObject("data").GetValue("key"))
}
t.Log(i, value)
})
Expand Down

0 comments on commit 5f0b391

Please sign in to comment.