github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/infra/conf/json/json_test.go (about)

     1  package json_test
     2  
     3  import (
     4  	"encoding/json"
     5  	"reflect"
     6  	"testing"
     7  )
     8  
     9  func assertResult(t *testing.T, value map[string]interface{}, expected string) {
    10  	e := make(map[string]interface{})
    11  	err := json.Unmarshal([]byte(expected), &e)
    12  	if err != nil {
    13  		t.Error(err)
    14  	}
    15  	if !reflect.DeepEqual(value, e) {
    16  		bs, _ := json.Marshal(value)
    17  		t.Fatalf("expected:\n%s\n\nactual:\n%s", expected, string(bs))
    18  	}
    19  }