test: improve test case

This commit is contained in:
fatedier
2016-03-15 18:45:57 +08:00
parent a52e77f6ed
commit 8ed55e1288
4 changed files with 11 additions and 11 deletions

View File

@@ -25,7 +25,7 @@ func TestEncrypto(t *testing.T) {
pp.Init([]byte("Hana"))
res, err := pp.Encrypto([]byte("Just One Test!"))
if err != nil {
t.Error(err)
t.Fatalf(err)
}
fmt.Printf("[%x]\n", res)
@@ -36,12 +36,12 @@ func TestDecrypto(t *testing.T) {
pp.Init([]byte("Hana"))
res, err := pp.Encrypto([]byte("Just One Test!"))
if err != nil {
t.Error(err)
t.Fatalf(err)
}
res, err = pp.Decrypto(res)
if err != nil {
t.Error(err)
t.Fatalf(err)
}
fmt.Printf("[%s]\n", string(res))