Permalink
Browse files

Add another dependantsAfterMerge test

  • Loading branch information...
1 parent 422d72c commit f8638782fda6ce88fff22e71c777dcbaa4edd16c @johnynek johnynek committed Dec 11, 2015
Showing with 19 additions and 0 deletions.
  1. +19 −0 summingbird-core-test/src/test/scala/com/twitter/summingbird/DependantsTests.scala
@@ -219,4 +219,23 @@ object DependantsTest extends Properties("Dependants") {
}
}
}
+ /*
+ * dependencies of the results of dependantsAfterMerge are MergedProducer, AlsoProducer or the
+ * argument.
+ */
+ property("dependantsAfterMerge(x).flatMap(dependenciesOf) is x, Also or Merged") = forAll { (prod: Producer[Memory, _]) =>
+ val dependants = Dependants(prod)
+ import dependants._
+
+ nodes.forall { n =>
+ dependantsAfterMerge(n)
+ .flatMap(Producer.dependenciesOf)
+ .forall {
+ case node if node == n => true
+ case AlsoProducer(_, _) => true
+ case MergedProducer(_, _) => true
+ case _ => false
+ }
+ }
+ }
}

0 comments on commit f863878

Please sign in to comment.