Răsfoiți Sursa

Fixed basic block unit test.

Taddeus Kroes 14 ani în urmă
părinte
comite
c94f0225e4
1 a modificat fișierele cu 5 adăugiri și 3 ștergeri
  1. 5 3
      tests/test_dataflow.py

+ 5 - 3
tests/test_dataflow.py

@@ -20,9 +20,11 @@ class TestDataflow(unittest.TestCase):
 
     def test_find_basic_blocks(self):
         s = self.statements
-        self.assertEqual(map(lambda b: b.statements, find_basic_blocks(s)), \
-                [B(s[:2]).statements, B(s[2:4]).statements, \
-                 B(s[4:]).statements])
+        self.assertEqual(
+                map(lambda b: b.statements, find_basic_blocks(s)[:-1]),
+                [B(s[:2]).statements, B(s[2:4]).statements,
+                    B(s[4:]).statements]
+        )
 
     def test_generate_flow_graph_simple(self):
         b1 = B([S('command', 'foo'), S('command', 'j', 'b2')])