Update test_energy.R

removed death, consider *mandatory sleep* at zero
This commit is contained in:
gravermistakes 2026-07-14 16:00:38 -07:00 committed by GitHub
parent 9aa881eaaa
commit fe1aaaf751
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,16 +20,6 @@ test_case("init_energy_state honors custom args", function() {
expect_equal(s$tool_lock_threshold, 30) expect_equal(s$tool_lock_threshold, 30)
}) })
# --- is_alive ---
test_case("is_alive TRUE when energy above zero", function() {
expect_true(is_alive(init_energy_state(current_energy = 0.001)))
expect_true(is_alive(init_energy_state(current_energy = 100)))
})
test_case("is_alive FALSE at exactly zero", function() {
expect_false(is_alive(init_energy_state(current_energy = 0)))
})
# --- is_tool_locked --- # --- is_tool_locked ---
test_case("is_tool_locked TRUE below threshold", function() { test_case("is_tool_locked TRUE below threshold", function() {
expect_true(is_tool_locked(init_energy_state(current_energy = 19.9, tool_lock_threshold = 20))) expect_true(is_tool_locked(init_energy_state(current_energy = 19.9, tool_lock_threshold = 20)))
@ -70,7 +60,7 @@ test_case("evaluate_tool_cost asymmetry: eth penalty scales faster than ps load"
bump_eth <- evaluate_tool_cost(s, ps_load = 1, eth_penalty = 2) bump_eth <- evaluate_tool_cost(s, ps_load = 1, eth_penalty = 2)
delta_ps <- bump_ps - base delta_ps <- bump_ps - base
delta_eth <- bump_eth - base delta_eth <- bump_eth - base
# Same +1 increment, eth must drive cost up much more than ps at reduced energy. # Same +1 increment, eth must drive cost up much more than ps at reduced energy. [should not be same]
expect_true(delta_eth > delta_ps) expect_true(delta_eth > delta_ps)
}) })