Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
(when-not (empty? x) body) should be (when (seq x) body)
  • Loading branch information
miner committed Jul 9, 2012
1 parent a34d5c4 commit d68221f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/kibit/rules/collections.clj
Expand Up @@ -8,6 +8,7 @@

;; empty?
[(not (empty? ?x)) (seq ?x)]
[(when-not (empty? ?x) . ?y) (when (seq ?x) . ?y)]

;; set
[(into #{} ?coll) (set ?coll)])
Expand Down
2 changes: 2 additions & 0 deletions test/kibit/test/collections.clj
Expand Up @@ -6,6 +6,8 @@
(are [expected-alt-form test-form]
(= expected-alt-form (:alt (kibit/check-expr test-form)))
'(seq a) '(not (empty? a))
'(when (seq a) b) '(when-not (empty? a) b)
'(when (seq a) b) '(when (not (empty? a)) b)
'(vector a) '(conj [] a)
'(vector a b) '(conj [] a b)
'(vec coll) '(into [] coll)
Expand Down

0 comments on commit d68221f

Please sign in to comment.