Skip to content

Commit cc82c20

Browse files
committed
test(calc): emit the worked-example figures in -v output (om-nass)
So the +$69.50 → −$20 flip the bead describes is legible straight from the test log, not only from the source.
1 parent 110471d commit cc82c20

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/calc/calc_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ func TestCRHNetLifetime(t *testing.T) {
263263
// The lifetime figure restores the truth: the hunt made money.
264264
approx(t, "crh_net_lifetime = live + realized crh", r.CRHNetLifetime, 69.50)
265265

266+
// Emit the headline figures so `go test -v` carries the worked example in its
267+
// output — the flip this bead is about is legible without reading the source.
268+
t.Logf("om-nass worked example: crh_net_real = %.2f · realized_gain_crh = %.2f · crh_net_lifetime = %.2f",
269+
r.CRHNetReal, r.RealizedGainCRH, r.CRHNetLifetime)
270+
266271
// D4: Verdict() stays keyed on the LIVE figure — unchanged by this bead.
267272
if r.Verdict() != "COSTING MONEY" {
268273
t.Errorf("verdict = %q, want COSTING MONEY (Verdict keys off crh_net_real)", r.Verdict())

0 commit comments

Comments
 (0)