From 2955ec1400f3c9ca5b82fe09a165ccd6783f5793 Mon Sep 17 00:00:00 2001 From: Shantanu Sardesai Date: Fri, 31 Oct 2025 00:38:16 +0530 Subject: [PATCH] Add test cases for `with-meta` --- test/clojure/core_test/with-meta.cljc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/clojure/core_test/with-meta.cljc diff --git a/test/clojure/core_test/with-meta.cljc b/test/clojure/core_test/with-meta.cljc new file mode 100644 index 0000000..a5998f2 --- /dev/null +++ b/test/clojure/core_test/with-meta.cljc @@ -0,0 +1,12 @@ +(ns clojure.core-test.with-meta + (:require [clojure.test :as t :refer [deftest is]] + [clojure.core-test.portability #?(:cljs :refer-macros :default :refer) [when-var-exists]])) + +(when-var-exists clojure.core/first + (deftest test-first + (let* [meta-data {:foo 42}] + (is (= meta-data (meta (empty (with-meta [] meta-data))))) + (is (= meta-data (meta (empty (with-meta {} meta-data))))) + (is (= meta-data (meta (empty (with-meta #{} meta-data))))) + (is (= meta-data (meta (empty (with-meta '() meta-data)))))))) +