aboutsummaryrefslogtreecommitdiff
path: root/chksum
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-05-04 18:07:43 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-05-04 18:07:43 +0200
commit8c18992866cabc4e1d61fb39c0721017258de3a2 (patch)
treea4bd7b1812b7aeb2cf24aae69bc824a67c01a5b7 /chksum
parent64115c8f6af62fc244a1a60386b1a4e8a6c68cf3 (diff)
tests
Diffstat (limited to 'chksum')
-rw-r--r--chksum/chksum_test.go7
-rw-r--r--chksum/testdata/MD51
-rw-r--r--chksum/testdata/SHA11
-rw-r--r--chksum/testdata/SHA2561
-rw-r--r--chksum/testdata/SHA5121
-rw-r--r--chksum/testdata/SUM1
-rw-r--r--chksum/testdata/emtpy0
7 files changed, 9 insertions, 3 deletions
diff --git a/chksum/chksum_test.go b/chksum/chksum_test.go
index ebff6c1..9f14a5d 100644
--- a/chksum/chksum_test.go
+++ b/chksum/chksum_test.go
@@ -6,7 +6,10 @@ func TestParseFile(t *testing.T) {
testCases := []struct {
file string
}{
- {"testdata/SUM"},
+ {"testdata/MD5"},
+ {"testdata/SHA1"},
+ {"testdata/SHA256"},
+ {"testdata/SHA512"},
}
for _, tc := range testCases {
t.Run(tc.file, func(t *testing.T) {
@@ -16,7 +19,7 @@ func TestParseFile(t *testing.T) {
}
for _, cs := range checkList {
if err := cs.Check(); err != nil {
- t.Log(err)
+ t.Error(err)
}
}
})
diff --git a/chksum/testdata/MD5 b/chksum/testdata/MD5
new file mode 100644
index 0000000..68b2f14
--- /dev/null
+++ b/chksum/testdata/MD5
@@ -0,0 +1 @@
+MD5 (testdata/emtpy) = d41d8cd98f00b204e9800998ecf8427e
diff --git a/chksum/testdata/SHA1 b/chksum/testdata/SHA1
new file mode 100644
index 0000000..2857b6b
--- /dev/null
+++ b/chksum/testdata/SHA1
@@ -0,0 +1 @@
+SHA1 (testdata/emtpy) = da39a3ee5e6b4b0d3255bfef95601890afd80709
diff --git a/chksum/testdata/SHA256 b/chksum/testdata/SHA256
new file mode 100644
index 0000000..a16c460
--- /dev/null
+++ b/chksum/testdata/SHA256
@@ -0,0 +1 @@
+SHA256 (testdata/emtpy) = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
diff --git a/chksum/testdata/SHA512 b/chksum/testdata/SHA512
new file mode 100644
index 0000000..d8aabe9
--- /dev/null
+++ b/chksum/testdata/SHA512
@@ -0,0 +1 @@
+SHA512 (testdata/emtpy) = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
diff --git a/chksum/testdata/SUM b/chksum/testdata/SUM
deleted file mode 100644
index b5ddca0..0000000
--- a/chksum/testdata/SUM
+++ /dev/null
@@ -1 +0,0 @@
-MD5 (chksum.go) = 509551696ec317f7be76a03b13586218
diff --git a/chksum/testdata/emtpy b/chksum/testdata/emtpy
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/chksum/testdata/emtpy