diff --git a/engine/loader_local_test.go b/engine/loader_local_test.go index f502f1740..6097cfafb 100644 --- a/engine/loader_local_test.go +++ b/engine/loader_local_test.go @@ -21,6 +21,7 @@ package engine import ( "flag" "path" + "reflect" "testing" "github.com/cgrates/cgrates/config" @@ -393,18 +394,20 @@ func TestMatchLoadCsvWithStorRating(t *testing.T) { t.Fatal("Failed querying redis keys for csv data") } for _, key := range keysCsv { - var refVal []byte + var refMap map[string]interface{} for idx, rs := range []*RedisStorage{rsCsv, rsStor, rsApier} { qVal, err := rs.db.Get(key) + qMap := make(map[string]interface{}) + err = rs.ms.Unmarshal(qVal, qMap) if err != nil { t.Fatalf("Run: %d, could not retrieve key %s, error: %s", idx, key, err.Error()) } if idx == 0 { // Only compare at second iteration, first one is to set reference value - refVal = qVal + refMap = qMap continue } - if len(refVal) != len(qVal) { - t.Errorf("Missmatched data for key: %s\n\t reference val: %s \n\t retrieved val: %s\n on iteration: %d", key, refVal, qVal, idx) + if !reflect.DeepEqual(refMap, qVal) { + t.Errorf("Missmatched data for key: %s\n\t reference val: %+v \n\t retrieved val: %+v\n on iteration: %d", key, refMap, qMap, idx) } } }