forked from clj-kondo/clj-kondo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(ns clj-kondo.redundant-nesting-test | ||
(:require [clj-kondo.test-utils :refer [lint! assert-submaps]] | ||
[clojure.test :refer [deftest is testing]])) | ||
|
||
(deftest redundant-nesting-test | ||
(assert-submaps | ||
'({:file "<stdin>", :row 1, :col 10, :level :warning, :message "Nested use of min is redunant"}) | ||
(lint! "(min 5 2 (min 3 7))")) | ||
(assert-submaps | ||
'({:file "<stdin>", :row 1, :col 8, :level :warning, :message "Nested use of * is redunant"}) | ||
(lint! "(* 3 4 (* 5 6))")) | ||
(assert-submaps | ||
'({:file "<stdin>", :row 1, :col 18, :level :warning, :message "Nested use of str is redunant"}) | ||
(lint! "(str \"foo\" \"bar\" (str \"baz\" \"qux\"))")) | ||
(assert-submaps | ||
'({:file "<stdin>", :row 1, :col 21, :level :warning, :message "Nested use of concat is redunant"}) | ||
(lint! "(concat [1 2] [3 4] (concat [5 6] [7 8]))"))) |