Commit c94f0225 authored by Taddeus Kroes's avatar Taddeus Kroes

Fixed basic block unit test.

parent 95f32aab
...@@ -20,9 +20,11 @@ class TestDataflow(unittest.TestCase): ...@@ -20,9 +20,11 @@ class TestDataflow(unittest.TestCase):
def test_find_basic_blocks(self): def test_find_basic_blocks(self):
s = self.statements s = self.statements
self.assertEqual(map(lambda b: b.statements, find_basic_blocks(s)), \ self.assertEqual(
[B(s[:2]).statements, B(s[2:4]).statements, \ map(lambda b: b.statements, find_basic_blocks(s)[:-1]),
B(s[4:]).statements]) [B(s[:2]).statements, B(s[2:4]).statements,
B(s[4:]).statements]
)
def test_generate_flow_graph_simple(self): def test_generate_flow_graph_simple(self):
b1 = B([S('command', 'foo'), S('command', 'j', 'b2')]) b1 = B([S('command', 'foo'), S('command', 'j', 'b2')])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment