data.json

A test is written incorrectly so that it tests nothing

Details

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

Description

This test has the structure (is (= expr1) expr2), which can never fail, and tests nothing:

(deftest object-keys-must-be-strings
  (is (= "{\"1\":1,\"2\":2") (json-str (sorted-map 1 1 2 2))))

Found using a pre-release version of the Eastwood Clojure lint tool.

Activity

Hide
Stuart Sierra added a comment -

Marking old issues as 'closed'

Show
Stuart Sierra added a comment - Marking old issues as 'closed'
Hide
Andy Fingerhut added a comment -

Patch djson-15-v1.diff corrects the test, including adding a missing } character to the string to compare against.

Show
Andy Fingerhut added a comment - Patch djson-15-v1.diff corrects the test, including adding a missing } character to the string to compare against.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: