cosmos-sdk/types/account_test.go

25 lines
503 B
Go
Raw Normal View History

package types
import (
2017-03-23 17:51:50 -07:00
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestNilAccount(t *testing.T) {
2017-02-23 17:50:20 -08:00
var acc Account
//test Copy
accCopy := acc.Copy()
2017-03-23 17:51:50 -07:00
//note that the assert.True is used instead of assert.Equal because looking at pointers
assert.True(t, &acc != accCopy, fmt.Sprintf("Account Copy Error, acc1: %v, acc2: %v", &acc, accCopy))
assert.Equal(t, acc.Sequence, accCopy.Sequence)
//test sending nils for panic
var nilAcc *Account
nilAcc.String()
nilAcc.Copy()
}