Skip to content
Snippets Groups Projects
Commit 8349bc37 authored by Taddeüs Kroes's avatar Taddeüs Kroes
Browse files

Added FIXME for long node titles.

parent 39cde146
No related branches found
No related tags found
No related merge requests found
......@@ -183,7 +183,7 @@ def generate_graph(root, separator=' ', verbose=False):
try:
assert len(title_line) == len(edge_line)
except AssertionError: # pragma: nocover
except AssertionError as e: # pragma: nocover
print '------------------'
print 'line_width:', line_width
print 'title_line:', title_line, 'len:', len(title_line)
......@@ -191,7 +191,7 @@ def generate_graph(root, separator=' ', verbose=False):
len(edge_line))
print 'lines:'
print '\n'.join(map(lambda x: x + ' %d' % len(x), lines))
raise Exception()
raise e
# Add the line of this node before all child lines.
return [title_line, edge_line] + result
......
......@@ -175,6 +175,29 @@ class TestGraph(unittest.TestCase):
3 5 3 7
""")
def test_long_node_title(self):
x = Leaf('x')
p = Node('^', x, Leaf(2))
root = Node('sin', p)
self.assertEqualGraphs(generate_graph(root), """
sin
^
╭┴╮
x 2
""")
# FIXME: p[0] = Node('cos', x)
# FIXME: self.assertEqualGraphs(generate_graph(root), """
# FIXME: sin
# FIXME: │
# FIXME: ^
# FIXME: ╭─┴╮
# FIXME: cos 2
# FIXME: │
# FIXME: x
# FIXME: """)
def strip(self, s):
return s.replace('\n ', '\n')[1:-1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment