aboutsummaryrefslogtreecommitdiff
path: root/internal/item/house_edge_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-02 01:54:37 -0400
committerhistoria <[not public]>2026-10-02 01:54:37 -0400
commitd3a305d1d7962f82af2397760cf8008758bddd1d (patch)
treef91f0deb342c20f2993e5366f772c3432648f426 /internal/item/house_edge_test.go
parent8eea0e4e06a4aaa6a18edabd9897d3bea1ea2ca0 (diff)
downloadthehouseoficarus-d3a305d1d7962f82af2397760cf8008758bddd1d.tar.gz
feat: better 'list' bet table, multiple bets in baccarat
Diffstat (limited to 'internal/item/house_edge_test.go')
-rw-r--r--internal/item/house_edge_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/internal/item/house_edge_test.go b/internal/item/house_edge_test.go
new file mode 100644
index 0000000..574a68f
--- /dev/null
+++ b/internal/item/house_edge_test.go
@@ -0,0 +1,29 @@
+package item
+
+import "testing"
+
+// TestHouseEdgeItemDefinitions pins the two house-edge reference items: the
+// tile shows whole percent, the computus shows hundredths. Neither stacks
+// (the precision is a capability, not a quantity) and both are valuable
+// enough that a player will bank them rather than drop them.
+func TestHouseEdgeItemDefinitions(t *testing.T) {
+ store := NewItemStore("../../data")
+ for _, tc := range []struct {
+ id string
+ precision int
+ }{
+ {"house_edge_tile", 0},
+ {"house_edge_computus", 2},
+ } {
+ def, err := store.Load(tc.id)
+ if err != nil {
+ t.Fatalf("load %s: %v", tc.id, err)
+ }
+ if def.HouseEdgePrecision == nil || *def.HouseEdgePrecision != tc.precision {
+ t.Fatalf("%s: house_edge_precision = %v, want %d", tc.id, def.HouseEdgePrecision, tc.precision)
+ }
+ if def.Stackable {
+ t.Fatalf("%s must not stack (its precision is a capability, not a quantity)", tc.id)
+ }
+ }
+}