'A CTRL+D in the middle of a line doesn\'t close a connection,
but at the beginning of a line it does.'

@defer.inlineCallbacks
def test_controlD(self):

    self._testwrite('1    +    1')
    (yield self.recvlineClient.expect('\\+    1'))
    self._assertBuffer(['>>>    1    +    1'])
    self._testwrite((manhole.CTRL_D + '    +    1'))
    (yield self.recvlineClient.expect('\\+    1'))
    self._assertBuffer(['>>>    1    +    1    +    1'])
    self._testwrite('\n')
    (yield self.recvlineClient.expect('3\n>>>    '))
    self._testwrite(manhole.CTRL_D)
    d = self.recvlineClient.onDisconnection
    (yield self.assertFailure(d, error.ConnectionDone))
