mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 15:38:57 +01:00
57d5de6fba
git grep -l github.com/ncw/rclone | xargs -d'\n' perl -i~ -lpe 's|github.com/ncw/rclone|github.com/rclone/rclone|g' goimports -w `find . -name \*.go`
35 lines
626 B
Go
35 lines
626 B
Go
package tree
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"github.com/a8m/tree"
|
|
_ "github.com/rclone/rclone/backend/local"
|
|
"github.com/rclone/rclone/fs"
|
|
"github.com/rclone/rclone/fstest"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
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())
|
|
}
|