github.com/imannamdari/v2ray-core/v5@v5.0.5/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  }