annotate src/clojure/test_clojure/transients.clj @ 10:ef7dbbd6452c

added clojure source goodness
author Robert McIntyre <rlm@mit.edu>
date Sat, 21 Aug 2010 06:25:44 -0400
parents
children
rev   line source
rlm@10 1 (ns clojure.test-clojure.transients
rlm@10 2 (:use clojure.test))
rlm@10 3
rlm@10 4 (deftest popping-off
rlm@10 5 (testing "across a node boundary"
rlm@10 6 (are [n]
rlm@10 7 (let [v (-> (range n) vec)]
rlm@10 8 (= (subvec v 0 (- n 2)) (-> v transient pop! pop! persistent!)))
rlm@10 9 33 (+ 32 (inc (* 32 32))) (+ 32 (inc (* 32 32 32)))))
rlm@10 10 (testing "off the end"
rlm@10 11 (is (thrown-with-msg? IllegalStateException #"Can't pop empty vector"
rlm@10 12 (-> [] transient pop!)))))