Browse Source

docs: add SCENARIO/SECTION patterns to technical reference

test-refactor
cinnaboot 3 months ago
parent
commit
13b0eac98a
  1. 8
      docs/technical_reference.md

8
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. 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()`). Use `WithinAbs(expected, tolerance)` for floating-point comparisons (NOT `Approx()`).
## Hybrid Documentation Strategy ## Hybrid Documentation Strategy

Loading…
Cancel
Save