mirror of
https://github.com/rclone/rclone.git
synced 2024-12-28 09:59:27 +01:00
24 lines
349 B
Go
24 lines
349 B
Go
|
package rc
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"github.com/stretchr/testify/require"
|
||
|
)
|
||
|
|
||
|
func TestWriteJSON(t *testing.T) {
|
||
|
var buf bytes.Buffer
|
||
|
err := WriteJSON(&buf, Params{
|
||
|
"String": "hello",
|
||
|
"Int": 42,
|
||
|
})
|
||
|
require.NoError(t, err)
|
||
|
assert.Equal(t, `{
|
||
|
"Int": 42,
|
||
|
"String": "hello"
|
||
|
}
|
||
|
`, buf.String())
|
||
|
}
|