ana-ledger/ana/interest_test.go

27 lines
445 B
Go

package ana
import (
"testing"
"time"
)
func TestInterest(t *testing.T) {
input := newTestRegister()
got, err := RegisterWithCompoundingInterestPrediction(input, time.Hour*24*365, "X", .04)
if err != nil {
t.Fatal(err)
}
t.Logf("%+v", got)
if len(got) <= len(input) {
t.Error(len(got))
}
for _, date := range got.Dates() {
for name, balance := range got[date] {
t.Logf("%s | %s %s", date, name, balance.Debug())
}
}
}