From 666cd1440ae0ac0f8e8d210b35b935c218af670b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 15 Jan 2018 12:04:18 +0100 Subject: [PATCH] Make test confom to new requirement enforced in go 1.10 https://tip.golang.org/doc/go1.10#test. With out this change tests will always fails with go 1.10+. --- key_test.go | 4 ++-- sha1_test.go | 4 ++-- sha256_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/key_test.go b/key_test.go index 1bbaf10..3f064df 100644 --- a/key_test.go +++ b/key_test.go @@ -77,7 +77,7 @@ func TestMarshal(t *testing.T) { } tls_der := x509.MarshalPKCS1PrivateKey(tls_key) if !bytes.Equal(der, tls_der) { - t.Fatal("invalid private key der bytes: %s\n v.s. %s\n", + t.Fatalf("invalid private key der bytes: %s\n v.s. %s\n", hex.Dump(der), hex.Dump(tls_der)) } @@ -291,7 +291,7 @@ func TestMarshalEC(t *testing.T) { t.Fatal(err) } if !bytes.Equal(der, tls_der) { - t.Fatal("invalid private key der bytes: %s\n v.s. %s\n", + t.Fatalf("invalid private key der bytes: %s\n v.s. %s\n", hex.Dump(der), hex.Dump(tls_der)) } diff --git a/sha1_test.go b/sha1_test.go index 2c25978..37808b5 100644 --- a/sha1_test.go +++ b/sha1_test.go @@ -35,7 +35,7 @@ func TestSHA1(t *testing.T) { } if expected != got { - t.Fatal("exp:%x got:%x", expected, got) + t.Fatalf("exp:%x got:%x", expected, got) } } } @@ -73,7 +73,7 @@ func TestSHA1Writer(t *testing.T) { } if got != exp { - t.Fatal("exp:%x got:%x", exp, got) + t.Fatalf("exp:%x got:%x", exp, got) } } } diff --git a/sha256_test.go b/sha256_test.go index b4e7af8..467e503 100644 --- a/sha256_test.go +++ b/sha256_test.go @@ -35,7 +35,7 @@ func TestSHA256(t *testing.T) { } if expected != got { - t.Fatal("exp:%x got:%x", expected, got) + t.Fatalf("exp:%x got:%x", expected, got) } } } @@ -73,7 +73,7 @@ func TestSHA256Writer(t *testing.T) { } if got != exp { - t.Fatal("exp:%x got:%x", exp, got) + t.Fatalf("exp:%x got:%x", exp, got) } } }