Skip to content

test: guard walkthrough.repl against public API drift - #194

Open
felipeofdev-ai wants to merge 1 commit into
nubank:masterfrom
felipeofdev-ai:test/107-walkthrough-guard
Open

test: guard walkthrough.repl against public API drift#194
felipeofdev-ai wants to merge 1 commit into
nubank:masterfrom
felipeofdev-ai:test/107-walkthrough-guard

Conversation

@felipeofdev-ai

Copy link
Copy Markdown

Summary

  • Add state-flow.walkthrough-test asserting doc/walkthrough.repl exists, mentions the core teaching snippets, and that those state-flow.api vars still resolve.

Why

Issue #107 asked for a way to keep the walkthrough current. A lightweight content + resolve guard catches deletions/renames of the public API surface the doc teaches, without requiring a full REPL evaluation harness.

Fixes #107

Test plan

  • lein test state-flow.walkthrough-test (0 failures)
  • Full suite / CI

— Felipe Fernandes · Systems & Agentic AI Engineer
https://github.com/felipeofdev-ai · https://felipeofdev-ai.github.io/

Made with Cursor

Copilot AI review requested due to automatic review settings August 3, 2026 22:32
@felipeofdev-ai
felipeofdev-ai requested a review from a team as a code owner August 3, 2026 22:32
Add tests that the walkthrough file exists and still mentions key
state-flow.api entry points that resolve.

Fixes nubank#107

Signed-off-by: Felipe Fernandes <felipe.of.dev@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

One of the new tests can throw while slurping a missing walkthrough file, producing an error instead of a clear assertion failure (and failing when run in isolation).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Adds a lightweight regression test to prevent doc/walkthrough.repl from drifting away from the library’s intended public API surface by asserting key walkthrough snippets remain present and that referenced state-flow.api vars still resolve.

Changes:

  • Add a new test namespace that checks doc/walkthrough.repl exists.
  • Assert the walkthrough contains core teaching snippets and that the corresponding public API vars still resolve.
File summaries
File Description
test/state_flow/walkthrough_test.clj New tests to guard the walkthrough doc against public API drift by checking file presence, content snippets, and resolvable state-flow.api symbols.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment on lines +16 to +31
(let [body (slurp walkthrough-path)
required-snippets ["flow/swap-state"
"flow/get-state"
"match?"
"(flow \""
"(run"]]
(doseq [snippet required-snippets]
(is (string/includes? body snippet)
(str "walkthrough should mention " (pr-str snippet))))
(doseq [sym '[state-flow.api/swap-state
state-flow.api/get-state
state-flow.api/run
state-flow.api/match?
state-flow.api/flow]]
(is (some? (resolve sym))
(str "API var missing: " sym))))))
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.

Need a way to ensure that doc/walkthrough.repl stays current

2 participants