File: info_test.go

package info (click to toggle)
golang-github-rkoesters-xdg 0.0~git20181125.edd15b8-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 220 kB
  • sloc: makefile: 5
file content (25 lines) | stat: -rw-r--r-- 348 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package trash

import (
	"strings"
	"testing"
)

const trashinfo = `[Trash Info]
Path=/home/user/file.txt
DeletionDate=2006-01-02T15:04:05
`

func TestInfo(t *testing.T) {
	r := strings.NewReader(trashinfo)
	info, err := NewInfo(r)
	if err != nil {
		t.Error(err)
	}
	t.Log(trashinfo)
	t.Log(info)

	if info.String() != trashinfo {
		t.Fail()
	}
}