rename based on plans

This commit is contained in:
Bel LaPointe
2023-10-26 10:25:38 -06:00
parent c2ccb738bc
commit aa9b795abd
6 changed files with 0 additions and 0 deletions

35
ana/legacy_bpi_test.go Normal file
View File

@@ -0,0 +1,35 @@
package ana
import (
"slices"
"testing"
"time"
"gogs.inhome.blapointe.com/ana-ledger/ledger"
)
func TestBPIPrediction(t *testing.T) {
t.Run("fixed growth", func(t *testing.T) {
bpis := ledger.BPIs{
ledger.USD: ledger.BPI{
"2001-01": -1000,
"2001-02": 100,
},
}
got, err := BPIsWithFixedGrowthPrediction(bpis, time.Hour*24*365, string(ledger.USD), 0.06)
if err != nil {
t.Fatal(err)
}
dates := []string{}
for d := range got[ledger.USD] {
dates = append(dates, d)
}
slices.Sort(dates)
for _, d := range dates {
t.Logf("%s | %s %.2f", ledger.USD, d, got[ledger.USD][d])
}
})
}