'When stdin is closed and the protocol connected to it implements
L{IHalfCloseableProtocol}, the protocol\'s C{readConnectionLost} method
is called.'

def test_readConnectionLost(self):

    errorLogFile = self.mktemp()
    log.msg(('Child    process    logging    to    ' + errorLogFile))
    p = StandardIOTestProcessProtocol()
    p.onDataReceived = defer.Deferred()
    def cbBytes(ignored):
        d = p.onCompletion
        p.transport.closeStdin()
        return d
    p.onDataReceived.addCallback(cbBytes)
    def processEnded(reason):
        reason.trap(error.ProcessDone)
    d = self._requireFailure(p.onDataReceived, processEnded)
    self._spawnProcess(p, 'stdio_test_halfclose', errorLogFile)
    return d
