15
15
package spec
16
16
17
17
import (
18
- "encoding/json"
19
18
"testing"
20
19
20
+ json "github.com/goccy/go-json"
21
21
"github.com/stretchr/testify/assert"
22
22
"github.com/stretchr/testify/require"
23
23
)
24
24
25
25
const contactInfoJSON = `{
26
- "name": "wordnik api team",
27
- "url": "http://developer.wordnik.com",
28
-
29
- "x-teams": "test team"
26
+ "name": "wordnik api team",
27
+ "url": "http://developer.wordnik.com",
28
+
29
+ "x-teams": "test team"
30
30
}`
31
31
32
32
var contactInfo = ContactInfo {ContactInfoProps : ContactInfoProps {
@@ -36,9 +36,9 @@ var contactInfo = ContactInfo{ContactInfoProps: ContactInfoProps{
36
36
}, VendorExtensible : VendorExtensible {Extensions : map [string ]interface {}{"x-teams" : "test team" }}}
37
37
38
38
func TestIntegrationContactInfo (t * testing.T ) {
39
- b , err := json .MarshalIndent (contactInfo , "" , "\t " )
39
+ b , err := json .MarshalIndent (contactInfo , "" , " " )
40
40
require .NoError (t , err )
41
- assert .Equal (t , contactInfoJSON , string (b ))
41
+ assert .JSONEq (t , contactInfoJSON , string (b ))
42
42
43
43
actual := ContactInfo {}
44
44
err = json .Unmarshal ([]byte (contactInfoJSON ), & actual )
0 commit comments