cosmos-sdk/types/account_test.go

24 lines
483 B
Go
Raw Normal View History

package types
import (
"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
2017-04-17 16:53:06 -07:00
assert.True(t, &acc != accCopy, "Account Copy Error, acc1: %v, acc2: %v", &acc, accCopy)
2017-03-23 17:51:50 -07:00
assert.Equal(t, acc.Sequence, accCopy.Sequence)
//test sending nils for panic
var nilAcc *Account
nilAcc.String()
nilAcc.Copy()
}