mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
fs/rc: add more infrastructure to help writing rc functions
- Fs cache for rc commands - Helper functions for parsing the input - Reshape command for manipulating JSON blobs - Background Job starting, control, query and expiry
This commit is contained in:
23
fs/rc/rc_test.go
Normal file
23
fs/rc/rc_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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())
|
||||
}
|
||||
Reference in New Issue
Block a user