diff options
| author | historia <[not public]> | 2026-10-03 00:51:41 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-03 00:51:41 -0400 |
| commit | 82e571d227feeafd0af4011e701ce26b99c5e3d9 (patch) | |
| tree | ab4d56ddf94c3bf3b42fff5dfc2ff9a339f09113 /internal/casino/house_edge_test.go | |
| parent | cac16d1725c46c82a2e62b84c93f7090b2ce0746 (diff) | |
| download | thehouseoficarus-82e571d227feeafd0af4011e701ce26b99c5e3d9.tar.gz | |
fix: craps felt and wager description cleanup
Diffstat (limited to 'internal/casino/house_edge_test.go')
| -rw-r--r-- | internal/casino/house_edge_test.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/casino/house_edge_test.go b/internal/casino/house_edge_test.go index 5f75e44..0704edc 100644 --- a/internal/casino/house_edge_test.go +++ b/internal/casino/house_edge_test.go @@ -108,6 +108,41 @@ func TestUnrecognizedTargetNeverInherits(t *testing.T) { } } +// TestCrapsGroupedTargetsHaveRTP: the list names grouped rows (4/10, buy <n>, +// odds pass / come). Each must resolve to a real edge, not the unknown dash. +func TestCrapsGroupedTargetsHaveRTP(t *testing.T) { + for _, bet := range []string{ + "place 4/10", "place 5/9", "place 6/8", + "hard 4/10", "hard 6/8", + "odds pass / come", "odds dont <n>", + "buy <n>", "lay <n>", + } { + got := (TableConfig{Game: GameCraps}).HouseEdge(bet) + if len(got.Parts) == 0 { + t.Fatalf("%s has no RTP: %s", bet, got.Note) + } + } + crapless := TableConfig{Game: GameCraps, Craps: CrapsConfig{Variant: "crapless"}} + for _, bet := range []string{"place 2/12", "place 3/11"} { + got := crapless.HouseEdge(bet) + if len(got.Parts) == 0 { + t.Fatalf("crapless %s has no RTP: %s", bet, got.Note) + } + } + // The <n> rows expand to every legal number, including the crapless extras. + for _, want := range []string{"2", "3", "11", "12"} { + found := false + for _, part := range crapless.HouseEdge("lay <n>").Parts { + if part.Label == want { + found = true + } + } + if !found { + t.Fatalf("crapless lay <n> missing number %s", want) + } + } +} + // TestHopBetsTwoParts pins the split hop analysis (easy vs doubles). func TestHopBetsTwoParts(t *testing.T) { got := (TableConfig{Game: GameCraps}).HouseEdge("hop <a> <b>") |
