diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-10 20:52:57 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-10 20:52:57 -0800 |
commit | 337508c82cbe598b8796fc532cd92e8230b099cb (patch) | |
tree | 8e1732b4978a7d9e40dc545bb1dd1fdc8acdf2e9 /core/src/test/scala/forge/TestUtil.scala | |
parent | 79bfb324a231bb3f46a180039b6d68ca042f181b (diff) | |
download | mill-337508c82cbe598b8796fc532cd92e8230b099cb.tar.gz mill-337508c82cbe598b8796fc532cd92e8230b099cb.tar.bz2 mill-337508c82cbe598b8796fc532cd92e8230b099cb.zip |
rename forge -> mill
Diffstat (limited to 'core/src/test/scala/forge/TestUtil.scala')
-rw-r--r-- | core/src/test/scala/forge/TestUtil.scala | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/core/src/test/scala/forge/TestUtil.scala b/core/src/test/scala/forge/TestUtil.scala deleted file mode 100644 index 1ae60e6d..00000000 --- a/core/src/test/scala/forge/TestUtil.scala +++ /dev/null @@ -1,38 +0,0 @@ -package forge - -import forge.define.Task -import forge.util.{Args, OSet} -import utest.assert - -import scala.collection.mutable - -object TestUtil { - def test(inputs: Task[Int]*) = { - new Test(inputs, pure = inputs.nonEmpty) - } - - /** - * A dummy target that takes any number of inputs, and whose output can be - * controlled externally, so you can construct arbitrary dataflow graphs and - * test how changes propagate. - */ - class Test(override val inputs: Seq[Task[Int]], - val pure: Boolean) extends Task[Int]{ - var counter = 0 - override def evaluate(args: Args) = { - counter + args.args.map(_.asInstanceOf[Int]).sum - } - - override def sideHash = counter - } - def checkTopological(targets: OSet[Task[_]]) = { - val seen = mutable.Set.empty[Task[_]] - for(t <- targets.items.reverseIterator){ - seen.add(t) - for(upstream <- t.inputs){ - assert(!seen(upstream)) - } - } - } - -} |