'Arguments given to spawnProcess are passed to the child process as
originally intended.'

def test_processCommandLineArguments(self):

    us = 'twisted.internet.test.process_cli'
    args = ['hello', '"', '     DCTB |<>^&', '"\\\\"hello\\\\"', '"foo\\    bar    baz\\""']
    allChars = ''.join(map(chr, range(1, 255)))
    if isinstance(allChars, unicode):
        allChars.encode('utf-8')
    reactor = self.buildReactor()
    def processFinished(finishedArgs):
        (output, err, code) = finishedArgs
        output = output.split('\x00')
        output.pop()
        self.assertEqual(args, output)
    def shutdown(result):
        reactor.stop()
        return result
    def spawnChild():
        d = succeed(None)
        d.addCallback((lambda dummy: utils.getProcessOutputAndValue(pyExe, (['-m', us] + args), env=properEnv, reactor=reactor)))
        d.addCallback(processFinished)
        d.addBoth(shutdown)
    reactor.callWhenRunning(spawnChild)
    self.runReactor(reactor)
