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+.

This commit is contained in:
Jakub Čajka 2018-01-15 12:04:18 +01:00 committed by Jeff
parent e863d83e40
commit 666cd1440a
3 changed files with 6 additions and 6 deletions

View File

@ -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))
}

View File

@ -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)
}
}
}

View File

@ -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)
}
}
}