Permalink
Browse files

Add tests for cyclic dependencies

  • Loading branch information...
1 parent 09c519b commit ee4e471b98fa70de0d51acab271a0999c1e0a6a1 @stuartsierra committed Jun 3, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 test/com/stuartsierra/dependency_test.clj
View
13 test/com/stuartsierra/dependency_test.clj
@@ -62,3 +62,16 @@
(deftest t-topo-sort
(is (= '(one two three five six four seven)
(topo-sort g2))))
+
+(deftest t-no-cycles
+ (is (thrown? Exception
+ (-> (graph)
+ (depend :a :b)
+ (depend :b :c)
+ (depend :c :a)))))
+
+(deftest t-no-self-cycles
+ (is (thrown? Exception
+ (-> (graph)
+ (depend :a :b)
+ (depend :a :a)))))

0 comments on commit ee4e471

Please sign in to comment.