aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/house_edge_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/casino/house_edge_test.go')
-rw-r--r--internal/casino/house_edge_test.go35
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>")