tests passing
This commit is contained in:
@@ -76,7 +76,7 @@ func TestPredictionPredict(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
given: ledger.Balances{"X": ledger.Balance{"X": 5}},
|
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": {
|
"interest": {
|
||||||
prediction: Prediction{
|
prediction: Prediction{
|
||||||
@@ -94,7 +94,7 @@ func TestPredictionPredict(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
given: ledger.Balances{"X": ledger.Balance{"X": 5}},
|
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": {
|
"contribution, interest": {
|
||||||
prediction: Prediction{
|
prediction: Prediction{
|
||||||
@@ -105,7 +105,7 @@ func TestPredictionPredict(t *testing.T) {
|
|||||||
NewInterestPredictor("X", "X", 12),
|
NewInterestPredictor("X", "X", 12),
|
||||||
},
|
},
|
||||||
given: ledger.Balances{"X": ledger.Balance{"X": 5}},
|
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
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,10 +90,10 @@ func TestGetMonthlyAutoContributionRate(t *testing.T) {
|
|||||||
if len(got) != 2 {
|
if len(got) != 2 {
|
||||||
t.Error(got)
|
t.Error(got)
|
||||||
}
|
}
|
||||||
if got["x"] != 4 {
|
if got["x"] != 0 { // too few contribution
|
||||||
t.Error(got["x"])
|
t.Error(got["x"])
|
||||||
}
|
}
|
||||||
if got["y"] != 3 {
|
if got["y"] != 0 { // too few contribution
|
||||||
t.Error(got["y"])
|
t.Error(got["y"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user