@defer.inlineCallbacks
    def test_controlD(self):
        self._testwrite("1 + 1")
        yield self.recvlineClient.expect(r"\+ 1")
        self._assertBuffer([">>> 1 + 1"])

        self._testwrite(manhole.CTRL_D + " + 1")
        yield self.recvlineClient.expect(r"\+ 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)
A CTRL+D in the middle of a line doesn't close a connection,
dataset/ETHPy150Open twisted/twisted/twisted/conch/test/test_manhole.py/ManholeLoopbackMixin.test_controlD