update test

This commit is contained in:
白茶清欢 2022-01-17 18:41:59 +08:00
parent 1634f1bc5f
commit 10efd5d757

View File

@ -64,7 +64,7 @@ func TestSelect(t *testing.T) {
"height": 180, "height": 180,
"slice": []int{1, 2, 3}, "slice": []int{1, 2, 3},
}, },
"slice": []int{1, 2, 3}, "slice_data": []int{1, 2, 3},
"map": map[string]interface{}{"a": 1, "b": 2, "c": 4}, "map": map[string]interface{}{"a": 1, "b": 2, "c": 4},
"table": []map[string]interface{}{ "table": []map[string]interface{}{
{"name": "alex", "age": 18, "number": 1}, {"name": "alex", "age": 18, "number": 1},
@ -73,11 +73,7 @@ func TestSelect(t *testing.T) {
}, },
} }
rule := map[string]MapDataRule{ rule := map[string]MapDataRule{
"name": { "name": {MapKey: "user_name", DefaultValue: "用户姓名默认值", IsComplexType: false},
MapKey: "user_name",
DefaultValue: "用户姓名默认值",
IsComplexType: false,
},
"extra.age": {MapKey: "user_age", DefaultValue: "用户年龄默认值", IsComplexType: false}, "extra.age": {MapKey: "user_age", DefaultValue: "用户年龄默认值", IsComplexType: false},
"extra.height": {MapKey: "user_height", DefaultValue: "扩展高度默认值", IsComplexType: false}, "extra.height": {MapKey: "user_height", DefaultValue: "扩展高度默认值", IsComplexType: false},
"table.[].name": {MapKey: "slice.[].name_modify", DefaultValue: "列表姓名默认值", IsComplexType: false}, "table.[].name": {MapKey: "slice.[].name_modify", DefaultValue: "列表姓名默认值", IsComplexType: false},