[ANN] collection-check: validation for data structure variants

123 views
Skip to first unread message

Zach Tellman

unread,
Oct 30, 2013, 10:13:56 PM10/30/13
to clo...@googlegroups.com
It's relatively rare that people write variants of Clojure data structures.  Partially, this is because the existing data structures are quite good, but it's also because it's surprisingly difficult.  Clojure's vectors, sets, and maps each implement about a dozen interfaces with overlapping functionality, making it easy to think you've written something correct until someone accesses it in a way you didn't think to test.  I have written a number of alternate data structures [1] [2] [3], and each time there's been some lacunae of the standard API that I overlooked.

To make this easier for myself and others, I've written a library for the express purpose of validating data structures that are extensions of the standard three data structures: https://github.com/ztellman/collection-check.  It's already uncovered some minor bugs in my own libraries, as well as an issue with Clojure's own hash-sets and hash-maps [4].  I strongly encourage anyone who's playing around in this space to use it, and to let me know if there are invariants I've overlooked.

Enjoy,
Zach

Alex Baranosky

unread,
Oct 31, 2013, 1:44:51 AM10/31/13
to clo...@googlegroups.com
Thanks Zach for this cool testing library, and thanks Reid for simple-check!

Colin Fleming

unread,
Oct 31, 2013, 1:48:58 AM10/31/13
to clo...@googlegroups.com
This looks like a really useful library, but I mostly came here to say +1 for the use of "lacunae". Now I have to find a way to insert that into my own conversations.



--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Zach Tellman

unread,
Oct 31, 2013, 2:49:57 AM10/31/13
to clo...@googlegroups.com

Yes, this is some very simple sugar atop simple-check, Reid is owed most of the credit here.

On Oct 30, 2013 10:44 PM, "Alex Baranosky" <alexander...@gmail.com> wrote:
Thanks Zach for this cool testing library, and thanks Reid for simple-check!

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/W2oJzZnJ-9c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages