def testToCharPrev(self):
     cursor = TextDocumentCursor(self.doc)
     self.assertFalse(cursor.toCharPrev())
     cursor.toPos((1,4))
     self.assertTrue(cursor.toCharPrev())
     self.assertTrue(cursor.toCharPrev())
     self.assertTrue(cursor.toCharPrev())
     self.assertFalse(cursor.toCharPrev())
Beispiel #2
0
 def testToCharPrev(self):
     cursor = TextDocumentCursor(self.doc)
     self.assertFalse(cursor.toCharPrev())
     cursor.toPos((1, 4))
     self.assertTrue(cursor.toCharPrev())
     self.assertTrue(cursor.toCharPrev())
     self.assertTrue(cursor.toCharPrev())
     self.assertFalse(cursor.toCharPrev())
 def testToPos(self):
     cursor = TextDocumentCursor(self.doc)
     self.assertTrue(cursor.toPos( (1,1) ))
     self.assertTrue(cursor.toPos( (1,3) ))
     self.assertFalse(cursor.toPos( (0,1) ))
     self.assertFalse(cursor.toPos( (1,0) ))
     self.assertFalse(cursor.toPos( (1,30) ))
     self.assertFalse(cursor.toPos( (30,1) ))
Beispiel #4
0
 def testToPos(self):
     cursor = TextDocumentCursor(self.doc)
     self.assertTrue(cursor.toPos((1, 1)))
     self.assertTrue(cursor.toPos((1, 3)))
     self.assertFalse(cursor.toPos((0, 1)))
     self.assertFalse(cursor.toPos((1, 0)))
     self.assertFalse(cursor.toPos((1, 30)))
     self.assertFalse(cursor.toPos((30, 1)))
 def testPos(self):
     cursor = TextDocumentCursor(self.doc)
     self.assertEqual(cursor.pos, (1,1))
     cursor.toPos( (1,4) )
     self.assertEqual(cursor.pos, (1,4))
 def testToLastLine(self):
     cursor = TextDocumentCursor(self.doc)
     cursor.toPos((1,4))
     cursor.toLastLine()
     self.assertEqual(cursor.pos, (2,1))
 def testToLineEnd(self):
     cursor = TextDocumentCursor(self.doc)
     cursor.toPos((1,4))
     cursor.toLineEnd()
     self.assertEqual(cursor.pos, (1,6))
 def testToLineBeginning(self):
     cursor = TextDocumentCursor(self.doc)
     cursor.toPos((1,4))
     cursor.toLineBeginning()
     self.assertEqual(cursor.pos, (1,1))
Beispiel #9
0
 def testToLastLine(self):
     cursor = TextDocumentCursor(self.doc)
     cursor.toPos((1, 4))
     cursor.toLastLine()
     self.assertEqual(cursor.pos, (2, 1))
Beispiel #10
0
 def testToLineEnd(self):
     cursor = TextDocumentCursor(self.doc)
     cursor.toPos((1, 4))
     cursor.toLineEnd()
     self.assertEqual(cursor.pos, (1, 6))
Beispiel #11
0
 def testToLineBeginning(self):
     cursor = TextDocumentCursor(self.doc)
     cursor.toPos((1, 4))
     cursor.toLineBeginning()
     self.assertEqual(cursor.pos, (1, 1))
Beispiel #12
0
 def testPos(self):
     cursor = TextDocumentCursor(self.doc)
     self.assertEqual(cursor.pos, (1, 1))
     cursor.toPos((1, 4))
     self.assertEqual(cursor.pos, (1, 4))