diff --git a/tests/test_hourly_opencode_nvidia_contract.py b/tests/test_hourly_opencode_nvidia_contract.py index dc1410e..47c6483 100644 --- a/tests/test_hourly_opencode_nvidia_contract.py +++ b/tests/test_hourly_opencode_nvidia_contract.py @@ -128,3 +128,20 @@ def test_buyer_readme_identifies_the_opencode_nvidia_maintainer() -> None: assert "bounded OpenCode maintainer" in readme assert "`NVIDIA_NIM_API_KEY`" in readme assert "COPILOT_GITHUB_TOKEN" not in readme + + +def test_product_workflow_keeps_printf_escapes_on_indented_yaml_lines() -> None: + """Keep shell format escapes on one YAML line so workflow parsing succeeds.""" + workflow_lines = _read(PRODUCT_WORKFLOW_PATH).splitlines() + checksum_line = ( + " printf '%s %s\\n' " + '"$OPENCODE_SHA256" "$archive" | sha256sum --check -' + ) + fallback_line = ( + " printf '%s\\n' " + "'{\"type\":\"error\",\"message\":\"OpenCode produced no final result\"}' " + '>"$result_file"' + ) + + assert checksum_line in workflow_lines + assert fallback_line in workflow_lines