tools.analyzer

Two unit tests with incorrect parentheses

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

These two unit tests are of the form (is (= expr1) expr2), which always passes without testing anything because (= expr1) is true.

(is (= '(. b (a c))) (emit-form (ast (.a b c))))
  (is (= '(. b (a c))) (emit-form (ast (.a b (c)))))

Found using the newest Eastwood linter, :suspicious-test

Activity

Hide
Andy Fingerhut added a comment -

Patch tanal-35-v1.diff not only fixes the parenthesization, but also changes the second test to add parens around (c) in the expected value. Please verify that is correct before applying the patch.

Show
Andy Fingerhut added a comment - Patch tanal-35-v1.diff not only fixes the parenthesization, but also changes the second test to add parens around (c) in the expected value. Please verify that is correct before applying the patch.
Hide
Nicola Mometto added a comment -
Show
Nicola Mometto added a comment - Fixed: https://github.com/clojure/tools.analyzer/commit/50c862a02662882f7fc2351659ea67753a5f49ea We're going meta on this, thanks

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: