Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CLJ-1084 tests, update to latest test.generative

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
commit 12afbe885569a4519f2b31a2492d65e704352d69 1 parent fca9a62
@stuarthalloway stuarthalloway authored
Showing with 13 additions and 2 deletions.
  1. +1 −1  pom.xml
  2. +12 −1 test/clojure/test_clojure/data_structures.clj
View
2  pom.xml
@@ -48,7 +48,7 @@
<dependency>
<groupId>org.clojure</groupId>
<artifactId>test.generative</artifactId>
- <version>0.1.9</version>
+ <version>0.2.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
View
13 test/clojure/test_clojure/data_structures.clj
@@ -10,7 +10,8 @@
(ns clojure.test-clojure.data-structures
- (:use clojure.test))
+ (:use clojure.test
+ [clojure.test.generative :exclude (is)]))
;; *** Helper functions ***
@@ -19,6 +20,16 @@
(seq (reduce disj (set s1) (set s2))))
+;; *** Generative ***
+(defspec subcollection-counts-are-consistent
+ identity
+ [^collection coll]
+ (let [n (count coll)]
+ (dotimes [i n]
+ (is (= n
+ (+ i (count (nthnext coll i)))
+ (+ i (count (drop i coll))))))))
+
;; *** General ***
(defstruct equality-struct :a :b)
Please sign in to comment.
Something went wrong with that request. Please try again.