We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clojure 1.10.0, Java 11.0.8 master branch
(let [cmp (fn [a b] (- (hash a) (hash b)))] (= (pss/sorted-set-by cmp 1 -2 0 5) (pss/sorted-set-by cmp 1 -2 0 5))) ;; false (let [cmp (fn [a b] (- (hash a) (hash b)))] (= (sorted-set-by cmp 1 -2 0 5) (sorted-set-by cmp 1 -2 0 5))) ;; true
You can find other wrong data by using test.check:
(ns me.tonsky.persistent-sorted-set.generative (:require [clojure.test.check :as tc] [clojure.test.check.generators :as gen] [clojure.test.check.properties :as prop] [clojure.test.check.clojure-test :refer [defspec]] [me.tonsky.persistent-sorted-set :as pss])) (defspec hash-cmp 1000 (let [cmp (fn [a b] (- (hash a) (hash b)))] (prop/for-all [initial (gen/not-empty (gen/list gen/small-integer))] (let [a (pss/from-sequential cmp initial) b (pss/from-sequential cmp initial)] (comment (println) (prn a) (prn b) (prn (= a b))) (= a b)))))
For strings:
(let [cmp (fn [a b] (- (hash a) (hash b)))] (= (pss/sorted-set-by cmp "" "9" "T10" "0") (pss/sorted-set-by cmp "" "9" "T10" "0"))) ;; false (let [cmp (fn [a b] (- (hash a) (hash b)))] (= (sorted-set-by cmp "" "9" "T10" "0") (sorted-set-by cmp "" "9" "T10" "0"))) ;; true
The text was updated successfully, but these errors were encountered:
but probably it's not a bug:
(let [cmp (fn [a b] (- (hash a) (hash b)))] (= (pss/sorted-set-by cmp 0 -1 2 -2) (pss/sorted-set-by cmp 0 -1 2 -2))) ;; true (let [cmp (fn [a b] (- (hash a) (hash b)))] (= (sorted-set-by cmp 0 -1 2 -2) (sorted-set-by cmp 0 -1 2 -2))) ;; false
Sorry, something went wrong.
No branches or pull requests
Clojure 1.10.0, Java 11.0.8
master branch
You can find other wrong data by using test.check:
For strings:
The text was updated successfully, but these errors were encountered: