diff options
Diffstat (limited to 'Scala/streams/src/test/scala')
-rw-r--r-- | Scala/streams/src/test/scala/streams/BloxorzSuite.scala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Scala/streams/src/test/scala/streams/BloxorzSuite.scala b/Scala/streams/src/test/scala/streams/BloxorzSuite.scala index 3f9329b..72ef1a4 100644 --- a/Scala/streams/src/test/scala/streams/BloxorzSuite.scala +++ b/Scala/streams/src/test/scala/streams/BloxorzSuite.scala @@ -53,6 +53,29 @@ class BloxorzSuite extends FunSuite { } } + test("neighborsWithHistory") { + new Level1 { + assert(neighborsWithHistory(Block(Pos(1,1),Pos(1,1)), List(Left,Up)) === + Stream( + (Block(Pos(1,2),Pos(1,3)), List(Right,Left,Up)), + (Block(Pos(2,1),Pos(3,1)), List(Down,Left,Up)) + )) + } + } + + test("newNeighborsOnly") { + new Level1 { + assert(newNeighborsOnly( + Set( + (Block(Pos(1,2),Pos(1,3)), List(Right,Left,Up)), + (Block(Pos(2,1),Pos(3,1)), List(Down,Left,Up))).toStream, + Set(Block(Pos(1,2),Pos(1,3)), Block(Pos(1,1),Pos(1,1))) + ) == + Set((Block(Pos(2,1),Pos(3,1)), List(Down,Left,Up))).toStream + ) + } + } + test("optimal solution for level 1") { new Level1 { assert(solve(solution) == Block(goal, goal)) |