Clojure

Syntactically broken clojure.test/are tests succeed

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.3
  • Fix Version/s: Release 1.4
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code
  • Approval:
    Ok

Description

While clojure.test/are is a very useful macro, it has one major flaw. If the assertion is syntactically incorrect, the test succeeds. Take this testcase:

(deftest broken-test
  (are [a b c] (= a b c)
       1 1))

See the error? The are form takes three values, but I have provided only two. The test simply passes.

Latest patch checks the number of arguments to are and throws an exception if they don't match.

Activity

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: