From 13b0eac98a6129de532585f4c137dcd34622ed34 Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Mon, 27 Apr 2026 14:32:31 -0400 Subject: [PATCH] docs: add SCENARIO/SECTION patterns to technical reference --- docs/technical_reference.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/technical_reference.md b/docs/technical_reference.md index 8d074b8..0c1fcef 100644 --- a/docs/technical_reference.md +++ b/docs/technical_reference.md @@ -297,6 +297,14 @@ SCENARIO tests group related assertions under SECTION sub-tests. Each SECTION is In `--list-tests` output, SCENARIO tests display with "Scenario: " prefix. When filtering by name, wildcards handle the prefix transparently. +#### SCENARIO/SECTION Patterns +- Setup between SCENARIO and SECTIONs = fixture (runs once per SECTION) +- Use lambdas that capture the fixture to eliminate repeated setup +- Reuse structs in-place (mutate fields) rather than recreating +- Single-line sections are valid: `SECTION("name") { helper(arg); }` +- One SECTION per test is fine — SCENARIO provides grouping + fixture scope +- `using Catch::Matchers::WithinAbs;` after all includes + Use `WithinAbs(expected, tolerance)` for floating-point comparisons (NOT `Approx()`). ## Hybrid Documentation Strategy