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

Function TestSortEntriesReverse

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

Source from the content-addressed store, hash-verified

137}
138
139func TestSortEntriesReverse(t *testing.T) {
140 entries := []files.IsMetadata{
141 &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: "/a"}},
142 &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: "/b"}},
143 &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: "/c"}},
144 }
145
146 sortEntries(entries, listOptions{sortBy: "name", reverse: true})
147
148 paths := []string{entryPath(entries[0]), entryPath(entries[1]), entryPath(entries[2])}
149 if paths[0] != "/c" || paths[1] != "/b" || paths[2] != "/a" {
150 t.Errorf("sort by name reverse = %v, want [/c /b /a]", paths)
151 }
152}
153
154func TestSortEntriesNoSort(t *testing.T) {
155 entries := []files.IsMetadata{

Callers

nothing calls this directly

Calls 2

sortEntriesFunction · 0.85
entryPathFunction · 0.85

Tested by

no test coverage detected