35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
from tests.timer_contract_support import run_timer_contract, assert_current_build_contract
|
|
from pathlib import Path
|
|
|
|
APP_JS = Path(__file__).resolve().parents[1] / "ui_builder" / "static" / "app.js"
|
|
TEXT = APP_JS.read_text(encoding="utf-8")
|
|
|
|
|
|
def block(start_marker: str, end_marker: str) -> str:
|
|
start = TEXT.index(start_marker)
|
|
end = TEXT.index(end_marker, start)
|
|
return TEXT[start:end]
|
|
|
|
|
|
def test_game_clock_helper_only_seeds_on_set():
|
|
"""Current native timer contract, executed against production functions."""
|
|
run_timer_contract('first_start')
|
|
run_timer_contract('pause_freezes')
|
|
run_timer_contract('resume_preserves_native')
|
|
|
|
|
|
def test_space_game_timer_uses_control_only_helper():
|
|
"""Current native timer contract, executed against production functions."""
|
|
run_timer_contract('web_first')
|
|
run_timer_contract('shortcut_resume')
|
|
|
|
|
|
def test_explicit_time_change_seeds_even_before_first_space():
|
|
"""Current native timer contract, executed against production functions."""
|
|
run_timer_contract('first_edit_before_activation')
|
|
|
|
|
|
def test_pause_event_never_writes_browser_time_to_vmix():
|
|
"""Current native timer contract, executed against production functions."""
|
|
run_timer_contract('native_events')
|