Clojure

test-clojure: change (are _ ...) to (are [x] (true? x) ...)

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.1
  • Component/s: None
  • Labels:
    None
  • Approval:
    Ok

Description

Old clojure.contrib.test-is framework used (are _ value1 value2 ...) syntax for testing if all values are logically true. New clojure.test uses (are [x] (true? x) value1 value2 ...) or (are [x] (if x true false) value1 value2 ...) and this change needs to be reflected in test_clojure/numbers.clj.

Activity

Hide
Assembla Importer added a comment -

fsodomka said: [file:dvCpAkANar3QdBeJe5afGb]: fixes test_clojure/numbers.clj

Show
Assembla Importer added a comment - fsodomka said: [file:dvCpAkANar3QdBeJe5afGb]: fixes test_clojure/numbers.clj
Hide
Assembla Importer added a comment -

fsodomka said: [file:damCkoAVKr3PdgeJe5afGb]: fixes test_clojure/numbers.clj

Show
Assembla Importer added a comment - fsodomka said: [file:damCkoAVKr3PdgeJe5afGb]: fixes test_clojure/numbers.clj
Hide
Assembla Importer added a comment -

fsodomka said: Parent association with ticket #131 was added

Show
Assembla Importer added a comment - fsodomka said: Parent association with ticket #131 was added
Hide
Assembla Importer added a comment -

richhickey said: I don't understand this.

Show
Assembla Importer added a comment - richhickey said: I don't understand this.
Hide
Assembla Importer added a comment -

fsodomka said: Old 'are' had syntax (are condition expr1 expr2 ...), but new 'are' has (are params-vector condition expr1 expr2 ...). Tests in numbers.clj were updated with params-vector [x], but no condition were given.

user=> (macroexpand-1 '(are [x] true false nil))
(clojure.template/do-template [x] (clojure.test/is true) false nil)

Clearly, test (are [x] true false nil) will never fail, because first value is logically true and false and nil will never be considered.

See more explanation in:
http://groups.google.com/group/clojure-dev/browse_frm/thread/d0fd9d717db1e1db

Show
Assembla Importer added a comment - fsodomka said: Old 'are' had syntax (are condition expr1 expr2 ...), but new 'are' has (are params-vector condition expr1 expr2 ...). Tests in numbers.clj were updated with params-vector [x], but no condition were given. user=> (macroexpand-1 '(are [x] true false nil)) (clojure.template/do-template [x] (clojure.test/is true) false nil) Clearly, test (are [x] true false nil) will never fail, because first value is logically true and false and nil will never be considered. See more explanation in: http://groups.google.com/group/clojure-dev/browse_frm/thread/d0fd9d717db1e1db
Hide
Assembla Importer added a comment -

fsodomka said: (In [[r:6e29153854c799cb46abc23382059d6ee20e755e]]) fixed test-clojure, refs #144

Signed-off-by: Chouser <chouser@n01se.net>

Branch: master

Show
Assembla Importer added a comment - fsodomka said: (In [[r:6e29153854c799cb46abc23382059d6ee20e755e]]) fixed test-clojure, refs #144 Signed-off-by: Chouser <chouser@n01se.net> Branch: master

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: