'When {HistoricRecvLine} receives a newline, it adds the current
line buffer to the end of its history buffer.'

def test_newline(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'), ()))
    kR('c')
    kR('b')
    kR('a')
    self.assertEqual(self.p.currentHistoryBuffer(), (('xyz', 'abc', '123'), ()))
    kR('\n')
    self.assertEqual(self.p.currentHistoryBuffer(), (('xyz', 'abc', '123', 'cba'), ()))
