35 lines · 659 B · Go
RawDownload
package tree import (	"bytes"	"context"	"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(context.Background(), "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())}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t