mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 23:49:15 +01:00
36 lines
618 B
Go
36 lines
618 B
Go
package tree
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"github.com/a8m/tree"
|
|
"github.com/ncw/rclone/fs"
|
|
"github.com/ncw/rclone/fstest"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
_ "github.com/ncw/rclone/backend/local"
|
|
)
|
|
|
|
func TestTree(t *testing.T) {
|
|
fstest.Initialise()
|
|
|
|
buf := new(bytes.Buffer)
|
|
|
|
f, err := fs.NewFs("testfiles")
|
|
require.NoError(t, err)
|
|
err = Tree(f, buf, new(tree.Options))
|
|
require.NoError(t, err)
|
|
assert.Equal(t, `/
|
|
├── file1
|
|
├── file2
|
|
├── file3
|
|
└── subdir
|
|
├── file4
|
|
└── file5
|
|
|
|
1 directories, 5 files
|
|
`, buf.String())
|
|
}
|