'When L{HistoricRecvLine} receives a LEFT_ARROW or
RIGHT_ARROW keystroke it moves the cursor left or right
in the current line buffer, respectively.'

def test_horizontalArrows(self):

    kR = (lambda ch: self.p.keystrokeReceived(ch, None))
    for ch in iterbytes('xyz'):
        kR(ch)
    self.assertEqual(self.p.currentLineBuffer(), ('xyz', ''))
    kR(self.pt.RIGHT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('xyz', ''))
    kR(self.pt.LEFT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('xy', 'z'))
    kR(self.pt.LEFT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('x', 'yz'))
    kR(self.pt.LEFT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('', 'xyz'))
    kR(self.pt.LEFT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('', 'xyz'))
    kR(self.pt.RIGHT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('x', 'yz'))
    kR(self.pt.RIGHT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('xy', 'z'))
    kR(self.pt.RIGHT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('xyz', ''))
    kR(self.pt.RIGHT_ARROW)
    self.assertEqual(self.p.currentLineBuffer(), ('xyz', ''))
