Treat this test as pseudo-code of what I wanted to report, it's from squint:
(deftest with-meta-on-lazy-seq-test
(testing "with-meta on a lazy seq carries metadata"
(is (eq {:x 1} (jsv! '(meta (with-meta (range 3) {:x 1})))))
(is (eq {:x 1} (jsv! '(meta (with-meta (concat [1] [2]) {:x 1})))))
(is (eq {:x 1} (jsv! '(meta (with-meta (lazy-seq [1 2 3]) {:x 1}))))))
(testing "does not realize or alias the original"
(is (eq [nil false [1 2 3]]
(jsv! '(let [a (lazy-seq [1 2 3])
b (with-meta a {:x 1})]
[(meta a) (realized? b) (vec b)]))))))
I'm actively working on getting squint to work with this test suite now, but there wasn't a test for this one yet.
Treat this test as pseudo-code of what I wanted to report, it's from squint:
I'm actively working on getting squint to work with this test suite now, but there wasn't a test for this one yet.