aboutsummaryrefslogtreecommitdiff
path: root/chksum/chksum_test.go
blob: e79973852ad7a29661663b308b5cc1aa53557ad2 (plain)
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
26
27
28
package chksum

import "testing"

func TestParseFile(t *testing.T) {
	testCases := []struct {
		file string
	}{
		{"testdata/MD5"},
		{"testdata/SHA1"},
		{"testdata/SHA256"},
		{"testdata/SHA512"},
		{"testdata/SHA512256"},
		{"testdata/mixed"},
		{"testdata/SIZE"},
	}
	for _, tc := range testCases {
		t.Run(tc.file, func(t *testing.T) {
			checkList, err := ParseFile(tc.file)
			if err != nil {
				t.Error(err)
			}
			if err := checkList.Check(); err != nil {
				t.Error(err)
			}
		})
	}
}