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

Function TestSortEntriesByTime

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

Source from the content-addressed store, hash-verified

101}
102
103func TestSortEntriesByTime(t *testing.T) {
104 entries := []files.IsMetadata{
105 &files.FileMetadata{
106 Metadata: files.Metadata{PathDisplay: "/new"},
107 ServerModified: dropbox.DBXTime(time.Date(2025, 6, 1, 0, 0, 0, 0, time.UTC)),
108 },
109 &files.FileMetadata{
110 Metadata: files.Metadata{PathDisplay: "/old"},
111 ServerModified: dropbox.DBXTime(time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC)),
112 },
113 &files.FolderMetadata{Metadata: files.Metadata{PathDisplay: "/folder"}},
114 }
115
116 sortEntries(entries, listOptions{sortBy: "time"})
117
118 paths := []string{entryPath(entries[0]), entryPath(entries[1]), entryPath(entries[2])}
119 if paths[0] != "/folder" || paths[1] != "/old" || paths[2] != "/new" {
120 t.Errorf("sort by time = %v, want [/folder /old /new]", paths)
121 }
122}
123
124func TestSortEntriesByType(t *testing.T) {
125 entries := []files.IsMetadata{

Callers

nothing calls this directly

Calls 2

sortEntriesFunction · 0.85
entryPathFunction · 0.85

Tested by

no test coverage detected