diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-05-18 14:20:03 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-11-10 18:03:25 +0100 |
commit | 2df58fc93a49a3ea3881d2cf74b6aeed1c2e37d9 (patch) | |
tree | 0ad5112cf82e131687ce2974c9277758982009e5 /Scala/streams/src/test/scala | |
parent | 68feb40b64c1e3bd5c329168473d0fca2e9d5190 (diff) | |
download | coursera-2df58fc93a49a3ea3881d2cf74b6aeed1c2e37d9.zip coursera-2df58fc93a49a3ea3881d2cf74b6aeed1c2e37d9.tar.gz |
Scala : streams assignment Scala : completedscala
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)) |