summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2017-10-28 19:19:20 -0700
committerLi Haoyi <haoyi.sg@gmail.com>2017-10-28 19:19:20 -0700
commitc2d3346178790d5b5c4462f55bfb0d23ad2b28a4 (patch)
tree49427907c659aeeec4f97e3f5606a3972018be9c /src/test
parent4b7a5c00bf43588f7970cfd3b800e8276918aab5 (diff)
downloadmill-c2d3346178790d5b5c4462f55bfb0d23ad2b28a4.tar.gz
mill-c2d3346178790d5b5c4462f55bfb0d23ad2b28a4.tar.bz2
mill-c2d3346178790d5b5c4462f55bfb0d23ad2b28a4.zip
split out TestGraph from TestUtil
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/forge/EvaluationTests.scala3
-rw-r--r--src/test/scala/forge/GraphTests.scala3
-rw-r--r--src/test/scala/forge/TestGraphs.scala73
-rw-r--r--src/test/scala/forge/TestUtil.scala56
4 files changed, 75 insertions, 60 deletions
diff --git a/src/test/scala/forge/EvaluationTests.scala b/src/test/scala/forge/EvaluationTests.scala
index d80781c0..c42aba80 100644
--- a/src/test/scala/forge/EvaluationTests.scala
+++ b/src/test/scala/forge/EvaluationTests.scala
@@ -2,14 +2,13 @@ package forge
import java.nio.{file => jnio}
-import forge.Target.test
import utest._
object EvaluationTests extends TestSuite{
val workspace = jnio.Paths.get("target/workspace")
val tests = Tests{
- val graphs = new TestUtil.TestGraphs()
+ val graphs = new TestGraphs()
import graphs._
'evaluateSingle - {
diff --git a/src/test/scala/forge/GraphTests.scala b/src/test/scala/forge/GraphTests.scala
index aead2d0c..86955fda 100644
--- a/src/test/scala/forge/GraphTests.scala
+++ b/src/test/scala/forge/GraphTests.scala
@@ -2,14 +2,13 @@ package forge
import utest._
import Target.test
-import java.nio.{file => jnio}
object GraphTests extends TestSuite{
val tests = Tests{
- val graphs = new TestUtil.TestGraphs()
+ val graphs = new TestGraphs()
import graphs._
'discovery{
diff --git a/src/test/scala/forge/TestGraphs.scala b/src/test/scala/forge/TestGraphs.scala
new file mode 100644
index 00000000..8dac142c
--- /dev/null
+++ b/src/test/scala/forge/TestGraphs.scala
@@ -0,0 +1,73 @@
+package forge
+
+import forge.Target.test
+
+class TestGraphs(){
+ // single
+ object singleton {
+ val single = test()
+ }
+
+ // up---down
+ object pair {
+ val up = test()
+ val down = test(up)
+ }
+
+ // up---o---down
+ object anonTriple{
+ val up = test()
+ val down = test(test(up))
+ }
+
+ // left
+ // / \
+ // up down
+ // \ /
+ // right
+ object diamond{
+ val up = test()
+ val left = test(up)
+ val right = test(up)
+ val down = test(left, right)
+ }
+
+ // o
+ // / \
+ // up down
+ // \ /
+ // o
+ object anonDiamond{
+ val up = test()
+ val down = test(test(up), test(up))
+ }
+
+ // o g-----o
+ // \ \ \
+ // o o h-----I---o
+ // \ / \ / \ / \ \
+ // A---c--o E o-o \ \
+ // / \ / \ / \ o---J
+ // o d o--o o / /
+ // \ / \ / /
+ // o o---F---o
+ // / /
+ // o--B o
+ object bigSingleTerminal{
+ val a = test(test(), test())
+ val b = test(test())
+ val e = {
+ val c = test(a)
+ val d = test(a)
+ test(test(test(), test(c)), test(test(c, test(d, b))))
+ }
+ val f = test(test(test(), test(e)))
+
+ val i = {
+ val g = test()
+ val h = test(g, e)
+ test(test(g), test(test(h)))
+ }
+ val j = test(test(i), test(i, f), test(f))
+ }
+}
diff --git a/src/test/scala/forge/TestUtil.scala b/src/test/scala/forge/TestUtil.scala
index f06dc6b6..8d944c65 100644
--- a/src/test/scala/forge/TestUtil.scala
+++ b/src/test/scala/forge/TestUtil.scala
@@ -1,6 +1,5 @@
package forge
-import forge.Target.test
import utest.assert
import scala.collection.mutable
@@ -17,59 +16,4 @@ object TestUtil {
}
}
- class TestGraphs(){
- object singleton {
- val single = test()
- }
- object pair {
- val up = test()
- val down = test(up)
- }
-
- object anonTriple{
- val up = test()
- val down = test(test(up))
- }
- object diamond{
- val up = test()
- val left = test(up)
- val right = test(up)
- val down = test(left, right)
- }
- object anonDiamond{
- val up = test()
- val down = test(test(up), test(up))
- }
-
- // o g-----o
- // \ \ \
- // o o h-----I---o
- // \ / \ / \ / \ \
- // A---c--o E o-o \ \
- // / \ / \ / \ o---J
- // o d o--o o / /
- // \ / \ / /
- // o o---F---o
- // / /
- // o--B o
- object bigSingleTerminal{
- val a = test(test(), test())
- val b = test(test())
- val e = {
- val c = test(a)
- val d = test(a)
- test(test(test(), test(c)), test(test(c, test(d, b))))
- }
- val f = test(test(test(), test(e)))
-
- val i = {
- val g = test()
- val h = test(g, e)
- test(test(g), test(test(h)))
- }
- val j = test(test(i), test(i, f), test(f))
- }
-
- (singleton, pair, anonTriple, diamond, anonDiamond, bigSingleTerminal)
- }
}