mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-03 01:38:24 -04:00
79320d34d4
* Chore: bump gopkg.in/yaml.v2 to gopkg.in/yaml.v3 * Test: fix YAML test * Test: refine json_test style
20 lines
402 B
Go
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))
|
|
}
|
|
}
|