github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/fs/rc/rc_test.go (about) 1 package rc 2 3 import ( 4 "bytes" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 "github.com/stretchr/testify/require" 9 ) 10 11 func TestWriteJSON(t *testing.T) { 12 var buf bytes.Buffer 13 err := WriteJSON(&buf, Params{ 14 "String": "hello", 15 "Int": 42, 16 }) 17 require.NoError(t, err) 18 assert.Equal(t, `{ 19 "Int": 42, 20 "String": "hello" 21 } 22 `, buf.String()) 23 }