Skip to content

Prefer YAML structures for JSON expectations#23

Merged
kexi merged 3 commits into
mainfrom
investigate-yaml-only-config
Jun 13, 2026
Merged

Prefer YAML structures for JSON expectations#23
kexi merged 3 commits into
mainfrom
investigate-yaml-only-config

Conversation

@kexi

@kexi kexi commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Document scenario examples in block-style YAML and show expect_json equals taking nested YAML map/list values that deserialize to typed JSON comparison values (the form was already accepted; this makes it the documented one).
  • Record the change in CHANGELOG.md (Unreleased) and SCHEMA.md so the scenario-format reference and release notes stay in sync with the README.
  • Add an e2e example and a parser test pinning the behavior.

Test plan

  • cargo test
  • cargo run -- run e2e/scenarios/positive/expect-json.yaml
  • CI green (lint, unit/integration, Windows, macOS, pty-e2e dogfood)

kexi and others added 3 commits June 9, 2026 01:26
Avoid making scenario authors embed JSON strings when typed YAML values already deserialize to the JSON comparison model. This keeps examples readable, reduces escaping, and locks the behavior with a focused parser test.
PR #23 documents nested YAML maps/lists as the preferred form for
expect_json equals, but left the Unreleased changelog entry and the
SCHEMA.md reference untouched. Without them, the scenario-format
reference would contradict the README and the release notes would
silently omit a documented-behavior change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PR #23 rewrote the JSON payload to use single quotes, which made the
literal JSON appear verbatim in the PTY echo of the typed command. The
expect guard matched the echoed "status" before bash ran, so expect_json
raced against a half-emitted buffer and intermittently read [1,2,3] as
the tail block (path 'result' does not exist). Gate on JSON_READY_42,
produced by $((40+2)) so it appears only in real output, never in echo.

Co-Authored-By: Claude <noreply@anthropic.com>
@kexi kexi merged commit 1ab9e60 into main Jun 13, 2026
16 checks passed
@kexi kexi deleted the investigate-yaml-only-config branch June 13, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant