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

Function TestSortEntriesBySize

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

Source from the content-addressed store, hash-verified

86}
87
88func TestSortEntriesBySize(t *testing.T) {
89 entries := []files.IsMetadata{
90 &files.FileMetadata{Metadata: files.Metadata{PathDisplay: "/big"}, Size: 1000},
91 &files.FileMetadata{Metadata: files.Metadata{PathDisplay: "/small"}, Size: 10},
92 &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: "/folder"}},
93 }
94
95 sortEntries(entries, listOptions{sortBy: "size"})
96
97 paths := []string{entryPath(entries[0]), entryPath(entries[1]), entryPath(entries[2])}
98 if paths[0] != "/folder" || paths[1] != "/small" || paths[2] != "/big" {
99 t.Errorf("sort by size = %v, want [/folder /small /big]", paths)
100 }
101}
102
103func TestSortEntriesByTime(t *testing.T) {
104 entries := []files.IsMetadata{

Callers

nothing calls this directly

Calls 2

sortEntriesFunction · 0.85
entryPathFunction · 0.85

Tested by

no test coverage detected