Skip to content

Commit

Permalink
Merge branch 'cljs-3299/trailing-keys'
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Jan 8, 2025
2 parents b1a891e + f42b150 commit f32f2ea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/cljs/cljs/core_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2042,3 +2042,17 @@
(is (= 11 @c))
(is (= [11 0] (reset-vals! c 0)))
(is (= 0 @c)))))

(defn test-keys [& {:as opts, :keys [a b]}]
[a b opts])

(deftest test-cljs-3299-trailing-keys
(testing "verify proper handling of trailing keys"
(is (= (test-keys :a 1, :b 2)
[1 2 {:a 1, :b 2}]))
(is (= (test-keys {:a 1, :b 2})
[1 2 {:a 1, :b 2}]))
(is (= (test-keys {:a 1, :b 2, :c 3})
[1 2 {:a 1, :b 2, :c 3}]))
(is (= (test-keys :d 4 {:a 1, :b 2, :c 3})
[1 nil {:d 4, :a 1, :c 3, nil nil}]))))

0 comments on commit f32f2ea

Please sign in to comment.