I’m after something like =, == and identical? but neither of those work like I want to.
I would like to write tests that report difference between [1 2 3] and '(1 2 3). Is that possible without using vector??
This doesn’t what I need:
(identical? '(1) '(1))
false
And same for:
(== '(1) '(1))
exception
So I’m using = but sometime it is annoying. For example when output is '([1 2] [3 4]). If something happens and output turns into '((1 2) (3 4)) I would like to know that without testing (first (vector? ....
I want to use it in clojure.test only since I understand that I should rather have code that can work with any collection rather than relying on vector / list.
Good point, thank you Serioga. For testing I’d like to have fn that distinguish between vector, set and everything else (list or what it returned from seq / map). I had a thought about something like (= (str ...) (str ...)) but that would be just sooo wrong ;-).
Thank you Dave. I googled that one and read it. I don’t remember the blog post from the second link but I spent enough time in Clojure (I’m NOT expert but I think I know core principles) to understand that I should not rely on data types. I should rely just on shape of my data. But I was hoping that specifically for clojure.test testing there will be something more than those three functions I know.