Commits

Juancarlo Añez  committed 767c9ff

Buffering tests were turned off and broken by the changes to LineInfo.

  • Participants
  • Parent commits 3a77022

Comments (0)

Files changed (1)

File grako/test/buffering_test.py

     def test_pos_consistency(self):
         line = col = 0
         for p, c in enumerate(self.text):
-            bl, bc = self.buf.line_info(p)[:2]
+            bl, bc = self.buf.line_info(p)[1:3]
             d = self.buf.next()
 #            print('tx', line, col, c.encode('string-escape'))
 #            print('bu', bl, bc, d.encode('string-escape'))
                 line += 1
             else:
                 col += 1
+
     def test_next_consisntency(self):
         while not self.buf.atend():
-            bl, bc = self.buf.line_info()[:2]
+            bl, bc = self.buf.line_info()[1:3]
 #            print('li', bl, bc)
 #            print('bu', self.buf.line, self.buf.col)
             self.assertEqual(bl, self.buf.line)
     def test_goto_consistency(self):
         for _ in range(100):
             self.buf.goto(random.randrange(len(self.text)))
-            bl, bc = self.buf.line_info()[:2]
+            bl, bc = self.buf.line_info()[1:3]
 #            print('li', bl, bc)
 #            print('bu', self.buf.line, self.buf.col)
             self.assertEqual(bl, self.buf.line)
             self.assertEqual(line, self.buf.get_line(n))
 
 def suite():
-    pass
+    return unittest.TestLoader().loadTestsFromTestCase(BufferingTests)
 
 def main():
-    unittest.main()
+    unittest.TextTestRunner(verbosity=2).run(suite())
 
 if __name__ == '__main__':
     main()