'When L{HistoricRecvLine} receives UP_ARROW or DOWN_ARROW
keystrokes it move the current index in the current history
buffer up or down, and resets the current line buffer to the
previous or next line in history, respectively for each.'

def test_verticalArrows(self):

    kR = (lambda ch: self.p.keystrokeReceived(ch, None))
    for ch in iterbytes('xyz\nabc\n123\n'):
        kR(ch)
    self.assertEqual(self.p.currentHistoryBuffer(), (('xyz', 'abc', '123'), ()))
    self.assertEqual(self.p.currentLineBuffer(), ('', ''))
    kR(self.pt.UP_ARROW)
    self.assertEqual(self.p.currentHistoryBuffer(), (('xyz', 'abc'), ('123',)))
    self.assertEqual(self.p.currentLineBuffer(), ('123', ''))
    kR(self.pt.UP_ARROW)
    self.assertEqual(self.p.currentHistoryBuffer(), (('xyz',), ('abc', '123')))
    self.assertEqual(self.p.currentLineBuffer(), ('abc', ''))
    kR(self.pt.UP_ARROW)
    self.assertEqual(self.p.currentHistoryBuffer(), ((), ('xyz', 'abc', '123')))
    self.assertEqual(self.p.currentLineBuffer(), ('xyz', ''))
    kR(self.pt.UP_ARROW)
    self.assertEqual(self.p.currentHistoryBuffer(), ((), ('xyz', 'abc', '123')))
    self.assertEqual(self.p.currentLineBuffer(), ('xyz', ''))
    for i in range(4):
        kR(self.pt.DOWN_ARROW)
    self.assertEqual(self.p.currentHistoryBuffer(), (('xyz', 'abc', '123'), ()))
