mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 18:51:39 +00:00
Clean up test cases -> testify
This commit is contained in:
@ -1,25 +1,20 @@
|
||||
package crypto
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestSimpleArmor(t *testing.T) {
|
||||
blockType := "MINT TEST"
|
||||
data := []byte("somedata")
|
||||
armorStr := EncodeArmor(blockType, nil, data)
|
||||
t.Log("Got armor: ", armorStr)
|
||||
|
||||
// Decode armorStr and test for equivalence.
|
||||
blockType2, _, data2, err := DecodeArmor(armorStr)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if blockType != blockType2 {
|
||||
t.Errorf("Expected block type %v but got %v", blockType, blockType2)
|
||||
}
|
||||
if !bytes.Equal(data, data2) {
|
||||
t.Errorf("Expected data %X but got %X", data2, data)
|
||||
}
|
||||
require.Nil(t, err, "%+v", err)
|
||||
assert.Equal(t, blockType, blockType2)
|
||||
assert.Equal(t, data, data2)
|
||||
}
|
||||
|
Reference in New Issue
Block a user