Skip to content

Migrate testStrataCommand.sh from the Strata repo#5

Open
atomb wants to merge 2 commits into
mainfrom
test-strata-command-script
Open

Migrate testStrataCommand.sh from the Strata repo#5
atomb wants to merge 2 commits into
mainfrom
test-strata-command-script

Conversation

@atomb

@atomb atomb commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This tests the strata command beyond running it to verify several examples.

CLI error handling and help output:

  • Proper error messages when no args, unknown commands, unknown flags, missing flag values, missing positional args, or extra positional args are passed
  • That error messages include per-command hints (e.g. strata check --help, strata diff --help)
  • Global --help output shows the expected description
  • Per-command --help works, including when mixed with other flags

Ion round-trip correctness:

  • Converts a dialect file (Arith) to Ion format via strata toIon
  • Pretty-prints the same dialect file via strata print
  • Prints the Ion file back and verifies it matches the pretty-printed original (byte-for-byte via cmp)

pyResolveOverloads error handling:

  • Verifies the command errors gracefully when given a nonexistent dispatch file

The script uses two helpers (expect_error and expect_output) that check for expected exit codes and substring matches in the output, tracking failures via a failed flag and exiting non-zero if anything fails.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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