diff --git a/testcases/stringrender/BinaryTreeRender.scala b/testcases/stringrender/BinaryTreeRender.scala index 901c330b8e7c4c4746b4c2f47c90253a7372e562..e019df6b65e7762d5c77c4eb2be58df18fe2f306 100644 --- a/testcases/stringrender/BinaryTreeRender.scala +++ b/testcases/stringrender/BinaryTreeRender.scala @@ -1,7 +1,7 @@ /** * Name: BinaryTreeRender.scala * Creation: 14.10.2015 - * Author: Mika�l Mayer (mikael.mayer@epfl.ch) + * Author: Mika�l Mayer (mikael.mayer@epfl.ch) * Comments: Binary tree rendering specifications. */ @@ -18,56 +18,56 @@ object TreeRender { /** Synthesis by example specs */ @inline def psStandard(s: Tree[Int])(res: String) = (s, res) passes { - case Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf)) => "Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf))" - case Node(Leaf, 1, Leaf) => "Node(Leaf, 1, Leaf)" - case Leaf => "Leaf" + case Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf())) => "Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf()))" + case Node(Leaf(), 1, Leaf()) => "Node(Leaf(), 1, Leaf())" + case Leaf() => "Leaf()" } @inline def psRemoveNode(s: Tree[Int])(res: String) = (s, res) passes { - case Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf)) => "((Leaf, 2, Leaf), 1, (Leaf, -3, Leaf))" - case Node(Leaf, 1, Leaf) => "(Leaf, 1, Leaf)" - case Leaf => "Leaf" + case Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf())) => "((Leaf(), 2, Leaf()), 1, (Leaf(), -3, Leaf()))" + case Node(Leaf(), 1, Leaf()) => "(Leaf(), 1, Leaf())" + case Leaf() => "Leaf()" } @inline def psRemoveLeaf(s: Tree[Int])(res: String) = (s, res) passes { - case Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf)) => "((, 2, ), 1, (, -3, ))" - case Node(Leaf, 1, Leaf) => "(, 1, )" - case Leaf => "" + case Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf())) => "((, 2, ), 1, (, -3, ))" + case Node(Leaf(), 1, Leaf()) => "(, 1, )" + case Leaf() => "" } @inline def psRemoveComma(s: Tree[Int])(res: String) = (s, res) passes { - case Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf)) => "((2), 1, (-3))" - case Node(Leaf, 1, Node(Leaf, 2, Leaf)) => "(1, (2))" - case Node(Node(Leaf, 2, Leaf), 1, Leaf) => "((2), 1)" - case Leaf => "" + case Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf())) => "((2), 1, (-3))" + case Node(Leaf(), 1, Node(Leaf(), 2, Leaf())) => "(1, (2))" + case Node(Node(Leaf(), 2, Leaf()), 1, Leaf()) => "((2), 1)" + case Leaf() => "" } @inline def psRemoveParentheses(s: Tree[Int])(res: String) = (s, res) passes { - case Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf)) => "(2), 1, (-3)" - case Node(Leaf, 1, Node(Leaf, 2, Leaf)) => "1, (2)" - case Node(Node(Leaf, 2, Leaf), 1, Leaf) => "(2), 1" - case Leaf => "" + case Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf())) => "(2), 1, (-3)" + case Node(Leaf(), 1, Node(Leaf(), 2, Leaf())) => "1, (2)" + case Node(Node(Leaf(), 2, Leaf()), 1, Leaf()) => "(2), 1" + case Leaf() => "" } @inline def psPrefix(s: Tree[Int])(res: String) = (s, res) passes { - case Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf)) => "1 (2) (-3)" - case Node(Leaf, 1, Node(Leaf, 2, Leaf)) => "1 () (2)" - case Node(Node(Leaf, 2, Leaf), 1, Leaf) => "1 (2) ()" - case Leaf => "()" + case Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf())) => "1 (2) (-3)" + case Node(Leaf(), 1, Node(Leaf(), 2, Leaf())) => "1 () (2)" + case Node(Node(Leaf(), 2, Leaf()), 1, Leaf()) => "1 (2) ()" + case Leaf() => "()" } @inline def psLispLike(s: Tree[Int])(res: String) = (s, res) passes { - case Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf)) => "(1 (2) (-3))" - case Node(Leaf, 1, Node(Leaf, 2, Leaf)) => "(1 () (2))" - case Node(Node(Leaf, 2, Leaf), 1, Leaf) => "(1 (2) ())" - case Leaf => "()" + case Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf())) => "(1 (2) (-3))" + case Node(Leaf(), 1, Node(Leaf(), 2, Leaf())) => "(1 () (2))" + case Node(Node(Leaf(), 2, Leaf()), 1, Leaf()) => "(1 (2) ())" + case Leaf() => "()" } @inline def psSuffix(s: Tree[Int])(res: String) = (s, res) passes { - case Node(Node(Leaf, 2, Leaf), 1, Node(Leaf, -3, Leaf)) => "(2) (-3) 1" - case Node(Leaf, 1, Node(Leaf, 2, Leaf)) => "() (2) 1" - case Node(Node(Leaf, 2, Leaf), 1, Leaf) => "(2) () 1" - case Leaf => "()" + case Node(Node(Leaf(), 2, Leaf()), 1, Node(Leaf(), -3, Leaf())) => "(2) (-3) 1" + case Node(Leaf(), 1, Node(Leaf(), 2, Leaf())) => "() (2) 1" + case Node(Node(Leaf(), 2, Leaf()), 1, Leaf()) => "(2) () 1" + case Leaf() => "()" } //////////////////////////////////////////////