MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestSortEntriesByName

Function TestSortEntriesByName

cmd/format_test.go:73–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestSortEntriesByName(t *testing.T) {
74 entries := []files.IsMetadata{
75 &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: "/Zebra"}},
76 &files.FileMetadata{Metadata: files.Metadata{PathDisplay: "/apple.txt"}},
77 &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: "/Banana"}},
78 }
79
80 sortEntries(entries, listOptions{sortBy: "name"})
81
82 paths := []string{entryPath(entries[0]), entryPath(entries[1]), entryPath(entries[2])}
83 if paths[0] != "/apple.txt" || paths[1] != "/Banana" || paths[2] != "/Zebra" {
84 t.Errorf("sort by name = %v, want [/apple.txt /Banana /Zebra]", paths)
85 }
86}
87
88func TestSortEntriesBySize(t *testing.T) {
89 entries := []files.IsMetadata{

Callers

nothing calls this directly

Calls 2

sortEntriesFunction · 0.85
entryPathFunction · 0.85

Tested by

no test coverage detected