Skip to content

Commit

Permalink
root_test: fix reflection warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
darkleaf committed Oct 15, 2024
1 parent 33e8612 commit c5507af
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions test/darkleaf/di/root_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
[darkleaf.di.core :as di]
[darkleaf.di.protocols :as p]))

(set! *warn-on-reflection* true)

(defn stoppable
{::di/stop (fn [*stopped?] (reset! *stopped? true))}
[{*stopped? ::*stopped?}]
Expand Down Expand Up @@ -49,31 +51,31 @@
([a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19] 19)
([a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20] 20)
([a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 & args] 21))})]
(t/is (= 0 (.call root)))
(t/is (= nil (.run root)))
(t/is (= 0 (root)))
(t/is (= 1 (root 1)))
(t/is (= 2 (root 1 2)))
(t/is (= 3 (root 1 2 3)))
(t/is (= 4 (root 1 2 3 4)))
(t/is (= 5 (root 1 2 3 4 5)))
(t/is (= 6 (root 1 2 3 4 5 6)))
(t/is (= 7 (root 1 2 3 4 5 6 7)))
(t/is (= 8 (root 1 2 3 4 5 6 7 8)))
(t/is (= 9 (root 1 2 3 4 5 6 7 8 9)))
(t/is (= 10 (root 1 2 3 4 5 6 7 8 9 10)))
(t/is (= 11 (root 1 2 3 4 5 6 7 8 9 10 11)))
(t/is (= 12 (root 1 2 3 4 5 6 7 8 9 10 11 12)))
(t/is (= 13 (root 1 2 3 4 5 6 7 8 9 10 11 12 13)))
(t/is (= 14 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14)))
(t/is (= 15 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))
(t/is (= 16 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)))
(t/is (= 17 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17)))
(t/is (= 18 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18)))
(t/is (= 19 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)))
(t/is (= 20 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)))
(t/is (= 21 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21)))
(t/is (= 2 (apply root 1 [2])))))
(t/is (= 0 (.call ^java.util.concurrent.Callable root)))
(t/is (= nil (.run ^java.lang.Runnable root)))
(t/is (= 0 (root)))
(t/is (= 1 (root 1)))
(t/is (= 2 (root 1 2)))
(t/is (= 3 (root 1 2 3)))
(t/is (= 4 (root 1 2 3 4)))
(t/is (= 5 (root 1 2 3 4 5)))
(t/is (= 6 (root 1 2 3 4 5 6)))
(t/is (= 7 (root 1 2 3 4 5 6 7)))
(t/is (= 8 (root 1 2 3 4 5 6 7 8)))
(t/is (= 9 (root 1 2 3 4 5 6 7 8 9)))
(t/is (= 10 (root 1 2 3 4 5 6 7 8 9 10)))
(t/is (= 11 (root 1 2 3 4 5 6 7 8 9 10 11)))
(t/is (= 12 (root 1 2 3 4 5 6 7 8 9 10 11 12)))
(t/is (= 13 (root 1 2 3 4 5 6 7 8 9 10 11 12 13)))
(t/is (= 14 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14)))
(t/is (= 15 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))
(t/is (= 16 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)))
(t/is (= 17 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17)))
(t/is (= 18 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18)))
(t/is (= 19 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)))
(t/is (= 20 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)))
(t/is (= 21 (root 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21)))
(t/is (= 2 (apply root 1 [2])))))

(t/deftest pr-test
(t/is (= "#darkleaf.di.core/root 42"
Expand Down

0 comments on commit c5507af

Please sign in to comment.