Skip to content

test runners ignoring reader comment macro #53

Open
@practicalli-johnny

Description

@practicalli-johnny

This is a bug in my understanding of the Clojure comment reader macro. Anything commented out with #_ still needs to be a valid form, otherwise how does the Clojure reader know where the comment ends :)

The CIDER test runner lets you get away with dodgy code in your source file, as it doesnt parse the source code file and just uses the expressions defined in the REPL already.

When running cognitect test runner

clojure -A:test:runner

An expression commented out with the #_ reader macro generated an error as the expression had a a missing value in a hashmap {()}

Terminal output

clojure -A:test:runner
Cloning: https://github.com/cognitect-labs/test-runner
Checking out: https://github.com/cognitect-labs/test-runner at 76568540e7f40268ad2b646110f237a60295fa3c
Downloading: org/clojure/tools.cli/0.3.5/tools.cli-0.3.5.jar from https://repo1.maven.org/maven2/

Running tests in #{"test"}
Syntax error reading source at (cervest/web_crawler.clj:93:10).
Map literal must contain an even number of forms

Full report at:
/tmp/clojure-67461614151858564.edn

The same thing happens with eftest :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions