Skip to content

docs(code): require a Given section in every test - #7

Merged
LNSD merged 1 commit into
mainfrom
lnsd/gwt-given-required
Aug 13, 2026
Merged

LNSD merged 1 commit into
mainfrom
lnsd/gwt-given-required

Conversation

@LNSD

@LNSD LNSD commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The marker table let //* Given be omitted when a test constructed nothing, which put the literal the case turns on inline in //* When beside the call under test; a test always has a precondition, and naming it is what keeps the two apart.

  • Mark //* Given required and say where the bare constants and literals go when there is nothing to construct.
  • Replace the example that omitted the marker with one binding its input to a named local, which also ports it off the unrelated types it was carrying.
  • Split the checklist item so the presence of all three markers and the no-setup case are ticked separately.

The marker table let `//* Given` be omitted when a test constructed nothing, which put the literal the case turns on inline in `//* When` beside the call under test; a test always has a precondition, and naming it is what keeps the two apart.

- Mark `//* Given` required and say where the bare constants and literals go when there is nothing to construct.
- Replace the example that omitted the marker with one binding its input to a named local, which also ports it off the unrelated types it was carrying.
- Split the checklist item so the presence of all three markers and the no-setup case are ticked separately.

Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
@LNSD
LNSD added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit 6d33e1b Aug 13, 2026
5 checks passed
@LNSD
LNSD deleted the lnsd/gwt-given-required branch August 13, 2026 11:07
@LNSD LNSD self-assigned this Aug 13, 2026
@LNSD LNSD changed the title docs: require a Given section in every test docs(code): require a Given section in every test Aug 13, 2026
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