diff options
| author | historia <[not public]> | 2026-09-16 17:05:17 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-16 17:05:17 -0400 |
| commit | 1dad15698845d370e998f7cc5feb8aece3fab58f (patch) | |
| tree | 8d58058782de9f422573e1f8efd5d130ce7d1ce9 /internal/game/economy_recovery_regression_test.go | |
| parent | a6cf03a6ae98e4fb675da25046d148e92bcf7206 (diff) | |
| download | thehouseoficarus-1dad15698845d370e998f7cc5feb8aece3fab58f.tar.gz | |
refactor: remove dead code, consolidate save/error handling, add lint gate
Diffstat (limited to 'internal/game/economy_recovery_regression_test.go')
| -rw-r--r-- | internal/game/economy_recovery_regression_test.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/internal/game/economy_recovery_regression_test.go b/internal/game/economy_recovery_regression_test.go index f818037..f9d3b37 100644 --- a/internal/game/economy_recovery_regression_test.go +++ b/internal/game/economy_recovery_regression_test.go @@ -17,7 +17,7 @@ import ( // startup recovery — the documented refund-on-crash policy. func TestRecoveryRefundsInFlightMachineWager(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = 100 @@ -46,7 +46,7 @@ func TestRecoveryRefundsInFlightMachineWager(t *testing.T) { // identical before and after a chip-only wager). func TestRecoveryRefundsChipOnlyWager(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = 100 @@ -80,7 +80,7 @@ func TestRecoveryRefundsChipOnlyWager(t *testing.T) { // settles the stake from that evidence — exactly once, no double refund. func TestRecoveryReappliesLostPayoutWithEvidence(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = 90 // post-debit balance: the 10-credit stake was charged @@ -113,7 +113,7 @@ func TestRecoveryReappliesLostPayoutWithEvidence(t *testing.T) { // records, newest processed first) both refund after a crash. func TestRecoveryRefundsSequentialStakes(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = 80 // bet 10 then doubled: 100 -> 90 -> 80 @@ -145,7 +145,7 @@ func TestRecoveryRefundsSequentialStakes(t *testing.T) { // the balance to `after` would silently drop 20 owed credits. func TestRecoveryReappliesIdenticalFailedPayouts(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = 90 // post-debit balance: both payouts failed to save @@ -177,7 +177,7 @@ func TestRecoveryReappliesIdenticalFailedPayouts(t *testing.T) { // player frees a slot, the same outstanding stake refunds successfully. func TestRefundOutstandingKeepsStakesOpenWithoutInventoryRoom(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.SetInvSlot(0, &player.InventorySlot{ItemID: "chips", Quantity: 10}) @@ -222,7 +222,7 @@ func TestRefundOutstandingKeepsStakesOpenWithoutInventoryRoom(t *testing.T) { // chips — the record stays open for operator inspection. func TestRecoveryKeepsWagerOpenWhenChipsDoNotFit(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { // Durable state at crash time: the 10-chip debit landed (10 -> 0 @@ -257,7 +257,7 @@ func TestRecoveryKeepsWagerOpenWhenChipsDoNotFit(t *testing.T) { // a liability is never silently dropped. func TestRecoveryPreservesAmbiguousPayout(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { // A payout owed at balance 100 failed to save; the player then @@ -298,7 +298,7 @@ func TestRecoveryPreservesAmbiguousPayout(t *testing.T) { // liability is never erased: its record stays open for operator inspection. func TestRecoveryKeepsUnpaidSiblingsOpenAtCreditCap(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = casino.MaxCredits - 30 @@ -332,7 +332,7 @@ func TestRecoveryKeepsUnpaidSiblingsOpenAtCreditCap(t *testing.T) { // may be settled only once nothing is owed. func TestRecoveryRestoresChipsFromMixedRefundCrash(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = 100 @@ -379,7 +379,7 @@ func TestRecoveryRestoresChipsFromMixedRefundCrash(t *testing.T) { // leaves the chip side outstanding. func TestRecoveryDoesNotReturnPaidChipStakeInKind(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = 100 @@ -414,7 +414,7 @@ func TestRecoveryDoesNotReturnPaidChipStakeInKind(t *testing.T) { // and silently erases the owed amount. func TestRecoveryUnpaidLiabilitySurvivesLaterRecoveries(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = casino.MaxCredits - 30 @@ -453,7 +453,7 @@ func TestRecoveryUnpaidLiabilitySurvivesLaterRecoveries(t *testing.T) { // applied — a reported win is never silently dropped. func TestCapBlockedPayoutIsJournaled(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = casino.MaxCredits @@ -499,7 +499,7 @@ func TestCapBlockedPayoutIsJournaled(t *testing.T) { // the open record is still owed. func TestRecoveryReappliesPartiallyPaidIdenticalPayouts(t *testing.T) { h := newHarness(t) - h.seedAccount("alice", "pw", false) + h.seedAccount("alice") p := h.seedCharacter("alice", "alice") h.g.RunOnOwner(func() { p.Credits = 90 |
