From de77e632f2b75830b6f592aa4b0a44f4d575f147 Mon Sep 17 00:00:00 2001 From: Alexandre Yang Date: Wed, 11 Mar 2026 09:06:28 +0100 Subject: [PATCH] Prefer scenario tests over Go tests in AGENTS.md testing guidelines Co-Authored-By: Claude Opus 4.6 --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 5c9f3563..d34973f2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,6 +28,7 @@ The shell is supported on Linux, Windows and macOS. ``` The test suite runs all scenarios against `debian:bookworm-slim` (GNU bash + GNU coreutils) and compares output byte-for-byte. Only set `skip_assert_against_bash: true` in a scenario when the behavior intentionally diverges from bash (e.g. sandbox restrictions, blocked commands). +- **Prefer scenario tests (`tests/scenarios/`) over Go tests.** Scenario tests are declarative YAML files that are automatically validated against both the shell and bash, making them easier to write, review, and maintain. Only use Go tests when scenario tests cannot express the required behaviour (e.g. testing Go APIs directly, complex programmatic assertions). - In test scenarios, use `expect.stderr` when possible instead of `stderr_contains`. - Test scenarios are asserted against bash by default. Only set `skip_assert_against_bash: true` for features that intentionally diverge from standard bash behavior (e.g. blocked commands, restricted redirects, readonly enforcement). - When expected output differs on Windows (e.g. path separators `\` vs `/`), use Windows-specific assertion fields: