diff --git a/utils/accountprofile_test.go b/utils/accountprofile_test.go index 1739a71e9..6a147dea7 100644 --- a/utils/accountprofile_test.go +++ b/utils/accountprofile_test.go @@ -19,6 +19,7 @@ along with this program. If not, see package utils import ( + "fmt" "reflect" "testing" "time" @@ -355,3 +356,22 @@ func TestAP_RestoreFromBackup(t *testing.T) { } } } + +func TestAP_AccountBalancesBackup(t *testing.T) { + actPrf := &AccountProfile{ + Balances: map[string]*Balance{ + "testKey": { + Units: &Decimal{decimal.New(1234, 3)}, + }, + }, + } + + actBk := actPrf.AccountBalancesBackup() + for key, value := range actBk { + if actPrf.Balances[key].Units.Big.Cmp(value) != 0 { + fmt.Println(actPrf.Balances[key].Units.Big, value) + t.Errorf("\ngot: <%+v>, \nwant: <%+v>", value, actPrf.Balances[key].Units.Big) + } + } + +}