@@ -2,6 +2,7 @@ package cjson
2
2
3
3
import (
4
4
"bytes"
5
+ "encoding/json"
5
6
"strings"
6
7
"testing"
7
8
)
@@ -52,13 +53,14 @@ func TestEncodeCanonical(t *testing.T) {
52
53
KeyType : "type" ,
53
54
Scheme : "scheme" ,
54
55
},
56
+ json .RawMessage (`{"_type":"targets","spec_version":"1.0","version":0,"expires":"0001-01-01T00:00:00Z","targets":{},"custom":{"test":true}}` ),
55
57
}
56
58
expectedResult := []string {
57
59
`{"keyid":"","keyid_hash_algorithms":null,"keytype":"","keyval":{"private":"","public":""},"scheme":""}` ,
58
60
`{"keyid":"id","keyid_hash_algorithms":["hash"],"keytype":"type","keyval":{"private":"priv","public":"pub"},"scheme":"scheme"}` ,
59
61
`{"false":false,"int":3,"int2":42,"nil":null,"string":"\\\"","true":true}` ,
60
62
`{"keyid":"id","keyid_hash_algorithms":["hash"],"keytype":"type","keyval":{"certificate":"cert","private":"priv","public":"pub"},"scheme":"scheme"}` ,
61
- "" ,
63
+ `{"_type":"targets","custom":{"test":true},"expires":"0001-01-01T00:00:00Z","spec_version":"1.0","targets":{},"version":0}` ,
62
64
}
63
65
for i := 0 ; i < len (objects ); i ++ {
64
66
result , err := EncodeCanonical (objects [i ])
0 commit comments