Uploaded image for project: 'Clojure'
  1. CLJ-931

Syntactically broken clojure.test/are tests succeed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: Release 1.3
    • Fix versions: Release 1.4
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code

      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.

        Attachments

          Activity

            People

            • Assignee:
              stuart.sierra Stuart Sierra
              Reporter:
              tsdh Tassilo Horn
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: