test(@projects/@magic-civilization): 🐛 drive happiness luxuries via owned_luxuries map (was stale unique_luxury_count)
The Rust HappinessInput reads owned_luxuries: BTreeMap<String,i32> (value 0 ⇒ config LUXURY_HAPPINESS=4), but the test passed a unique_luxury_count int the Rust no longer reads → 0 luxury happiness. Pass a two-entry owned_luxuries map. Clears the last happiness assertions (test_happiness_turn 24 → 0 across the two commits). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7d13970a3a
commit
eb833ee9b3
1 changed files with 4 additions and 2 deletions
|
|
@ -334,11 +334,13 @@ func test_luxury_count_adds_happiness_via_rust() -> void:
|
|||
var base_input: Dictionary = {
|
||||
"city_count": 1, "total_citizens": 3,
|
||||
"units_in_enemy_territory": 0,
|
||||
"building_happiness": 0, "unique_luxury_count": 0,
|
||||
"building_happiness": 0, "owned_luxuries": {},
|
||||
"growth_tier": "balanced",
|
||||
}
|
||||
var zero: Dictionary = gd.call("calculate", JSON.stringify(base_input))
|
||||
base_input["unique_luxury_count"] = 2
|
||||
# Rust HappinessInput reads an owned_luxuries map (value 0 ⇒ config default
|
||||
# LUXURY_HAPPINESS=4), not a unique_luxury_count int. Two entries ⇒ +8.
|
||||
base_input["owned_luxuries"] = {"silk": 0, "wine": 0}
|
||||
var two: Dictionary = gd.call("calculate", JSON.stringify(base_input))
|
||||
assert_eq(int(zero.get("luxury_happiness", 0)), 0,
|
||||
"zero luxuries must yield 0 luxury_happiness")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue