hyperfiddle / hyperfiddle/rcf

`deftest` generation at the REPL pollutes the namespace

Open
#41 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
301
Forks
14
PR merge metrics
No merged PRs in 30d

Description

clojure.test/deftest expends to def. It is named.

When tests expands to clojure.test/deftest, a unique name is generated (based on the line number).
If you move a tests block and re-evaluate it, the generated test get a new identity. It doesn’t overwrite its previous version, polluting the namespace.

All tests (current and previous versions) will be executed by clojure.test/run-tests.

Find a way to provide a stable identity to deftest, or to generate tests differently.

(t/deftest test-identity-name …)

Thanks to @seancorfield on Clojurians Slack for reporting the issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the implementation behind the tests expansion and clojure.test/deftest, then reproduce re-evaluation at the REPL and inspect what clojure.test/run-tests executes. Done means moving and re-evaluating a tests block no longer leaves an earlier generated test identity in the namespace or causes it to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
testing
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.