1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-17 13:05:24 +00:00
v2fly/infra/conf/json/json_test.go
秋のかえで 79320d34d4
Chore: bump gopkg.in/yaml.v2 to gopkg.in/yaml.v3 (#1828)
* Chore: bump gopkg.in/yaml.v2 to gopkg.in/yaml.v3

* Test: fix YAML test

* Test: refine json_test style
2022-07-13 21:21:32 +08:00

20 lines
402 B
Go

package json_test
import (
"encoding/json"
"reflect"
"testing"
)
func assertResult(t *testing.T, value map[string]interface{}, expected string) {
e := make(map[string]interface{})
err := json.Unmarshal([]byte(expected), &e)
if err != nil {
t.Error(err)
}
if !reflect.DeepEqual(value, e) {
bs, _ := json.Marshal(value)
t.Fatalf("expected:\n%s\n\nactual:\n%s", expected, string(bs))
}
}