json_filter/lexical_test.go

41 lines
788 B
Go
Raw Normal View History

// Package filter ...
//
// Description : filter ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2022-07-04 18:13
package filter
import (
2022-07-04 23:28:12 +08:00
"fmt"
"testing"
)
func Test_parseLexical(t *testing.T) {
2022-07-04 18:39:29 +08:00
jsonData := `{
"start" : 123456,
2022-07-04 23:17:02 +08:00
"name" : "zhangsan",
2022-07-04 18:39:29 +08:00
"age":"18",
"extension":{
"sex":"man",
"height":"180"
},
"teacher_list":[
{
"name":"t1",
"age":"11"
},
{
"name":"t2",
"age":"12"
}
]
}`
//jsonData = `{"name":"zhangsan","age":"18","extension":{"sex":"man","height":"180"},"teacher_list":[{"name":"t1","age":"11"},{"name":"t2","age":"12"}]}`
2022-07-05 14:05:57 +08:00
2022-07-05 14:42:43 +08:00
instance := NewLexical(jsonData)
_ = instance.Parse()
fmt.Println(instance.String())
}