(require '[clojure.core.rrb-vector :as fv]
'[clojure.core.rrb-vector.debug :as dv])
(def v1025 (into (fv/vector) (range 1025)))
(def v1024t (persistent! (pop! (transient v1025))))
;; This shows v1024t with nothing in it but a tail. Not correct.
;; Attempting to evaluate the expression below causes a
(= v1024t (range 1024))
;; It is not clear to me why this does not have a similar failure, but
;; I am pretty sure there is a similar bug waiting to happen in the
;; persistent version of popTail, too.
(def v1024 (pop v1025))
(= v1024 (range 1024))
With latest master version of code plus the new test case in patch crrbv-22-test-case-v1.patch, the new test case fails. With that plus the patch crrbv-22-fix-v1.patch, the new test case passes, as well as all existing ones.
Patch crrbv-22-cljs-fix-v1.patch is the same test cases and a similar fix for the ClojureScript code.
adds both clj and cljs test cases that fail without the fix, and fixes for both clj and cljs versions of the code, nearly identical to the patches attached to this ticket.
I will close this issue as resolved if build.clojure.org confirms everything passes.
New tests passing with the fixes on build.clojure.org. Closing as resolved.