Debian Codegraph @

trash/trash_test.go

raw
1 package trash
2
3 import (
4 "testing"
5 )
6
7 func TestListFiles(t *testing.T) {
8 files, err := Files()
9 if err != nil {
10 t.Error(err)
11 }
12 for _, i := range files {
13 t.Log(i)
14 }
15 }
16
17 func TestStat(t *testing.T) {
18 files, err := Files()
19 if err != nil {
20 t.Error(err)
21 }
22 for _, i := range files {
23 info, err := Stat(i)
24 if err != nil {
25 t.Error(err)
26 }
27 t.Log(info)
28 }
29 }
30
31 func TestIsEmpty(t *testing.T) {
32 // We can't expect a value for IsEmpty because it depends on the
33 // contents of the user's trash which could be empty or not. So
34 // we just call the function to make sure it doesn't panic or
35 // anything extreme.
36 t.Logf("IsEmpty()=%v", IsEmpty())
37 }