tests passing

This commit is contained in:
Bel LaPointe
2023-10-27 19:27:25 -06:00
parent c3d0498a89
commit 04a79add26
2 changed files with 5 additions and 5 deletions

View File

@@ -76,7 +76,7 @@ func TestPredictionPredict(t *testing.T) {
}),
},
given: ledger.Balances{"X": ledger.Balance{"X": 5}},
want: ledger.Register{theseK: ledger.Balances{"X": ledger.Balance{"X": 55}}},
want: ledger.Register{theseK: ledger.Balances{"X": ledger.Balance{"X": 5}}}, // too few contributions
},
"interest": {
prediction: Prediction{
@@ -94,7 +94,7 @@ func TestPredictionPredict(t *testing.T) {
}),
},
given: ledger.Balances{"X": ledger.Balance{"X": 5}},
want: ledger.Register{theseK: ledger.Balances{"X": ledger.Balance{"X": 60}}},
want: ledger.Register{theseK: ledger.Balances{"X": ledger.Balance{"X": 10}}}, // too few contributions
},
"contribution, interest": {
prediction: Prediction{
@@ -105,7 +105,7 @@ func TestPredictionPredict(t *testing.T) {
NewInterestPredictor("X", "X", 12),
},
given: ledger.Balances{"X": ledger.Balance{"X": 5}},
want: ledger.Register{theseK: ledger.Balances{"X": ledger.Balance{"X": 110}}},
want: ledger.Register{theseK: ledger.Balances{"X": ledger.Balance{"X": 10}}}, // too few contributions
},
}

View File

@@ -90,10 +90,10 @@ func TestGetMonthlyAutoContributionRate(t *testing.T) {
if len(got) != 2 {
t.Error(got)
}
if got["x"] != 4 {
if got["x"] != 0 { // too few contribution
t.Error(got["x"])
}
if got["y"] != 3 {
if got["y"] != 0 { // too few contribution
t.Error(got["y"])
}
}