ls: extend test sample with a second toplevel file

This commit is contained in:
Michael Eischer 2024-07-13 10:22:01 +02:00
parent 5671dfb481
commit bdf24dc8f9

View file

@ -150,13 +150,20 @@ func TestLsNcdu(t *testing.T) {
ModTime: modTime,
}, false)
printer.LeaveDir("/directory")
printer.Node("/file", &restic.Node{
Type: "file",
Name: "file",
Size: 12345,
ModTime: modTime,
}, false)
printer.Close()
rtest.Equals(t, `[1, 2, {"time":"0001-01-01T00:00:00Z","tree":null,"paths":["/example"],"hostname":"host"}, [{"name":"/"},
[
{"name":"directory","asize":0,"dsize":0,"dev":0,"ino":0,"nlink":0,"notreg":false,"uid":0,"gid":0,"mode":0,"mtime":1577934245},
{"name":"data","asize":42,"dsize":512,"dev":0,"ino":0,"nlink":0,"notreg":false,"uid":0,"gid":0,"mode":0,"mtime":1577934245}
]
],
{"name":"file","asize":12345,"dsize":12800,"dev":0,"ino":0,"nlink":0,"notreg":false,"uid":0,"gid":0,"mode":0,"mtime":1577934245}
]
]
`, buf.String())