def test_string_excludes_childless_nonterminals(self): tree = ParseTree(self.A, []) self.assertEqual(tree.string(), "")
def test_string_traverses_tree(self): tree = ParseTree(self.A, ["Hello", "world!"]) self.assertEqual(tree.string(), "Hello world!")