Update dependencies

This commit is contained in:
Eugene Yokota 2016-05-04 16:27:29 -04:00 committed by Dale Wijnand
parent d4c83c2c3c
commit b64e505746
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
1 changed files with 6 additions and 3 deletions

View File

@ -19,8 +19,11 @@ object DagSpecification extends Properties("Dag") {
val nodes = new HashSet[TestDag]
def nonterminalGen(p: Gen.Parameters): Gen[TestDag] =
{
for (i <- 0 until nodeCount; nextDeps <- Gen.someOf(nodes).apply(p))
nodes += new TestDag(i, nextDeps)
val seed = rng.Seed.random()
for {
i <- 0 until nodeCount
nextDeps <- Gen.someOf(nodes).apply(p, seed)
} nodes += new TestDag(i, nextDeps)
for (nextDeps <- Gen.someOf(nodes)) yield new TestDag(nodeCount, nextDeps)
}
Gen.parameterized(nonterminalGen)
@ -47,4 +50,4 @@ object DagSpecification extends Properties("Dag") {
}
class TestDag(id: Int, val dependencies: Iterable[TestDag]) extends Dag[TestDag] {
override def toString = id + "->" + dependencies.mkString("[", ",", "]")
}
}