From 2fc67c400f86037da78ea9d95c0b7981bd35213f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Mayer?= <a-mikmay@microsoft.com> Date: Thu, 15 Oct 2015 17:36:19 +0200 Subject: [PATCH] Corrected BinaryTreeRender.scala (Leaf() instead of Leaf) --- testcases/stringrender/BinaryTreeRender.scala | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/testcases/stringrender/BinaryTreeRender.scala b/testcases/stringrender/BinaryTreeRender.scala index 901c330b8..e019df6b6 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() => "()" } ////////////////////////////////////////////// -- GitLab