'Check \'ls\' works as expected. Checks for wildcards, hidden files,
listing directories and listing empty directories.'

def testList(self):

    def _check(results):
        self.assertEqual(results[0], ['testDirectory', 'testRemoveFile', 'testRenameFile', 'testfile1'])
        self.assertEqual(results[1], ['testDirectory', 'testRemoveFile', 'testRenameFile', 'testfile1'])
        self.assertEqual(results[2], ['testRemoveFile', 'testRenameFile'])
        self.assertEqual(results[3], ['.testHiddenFile', 'testRemoveFile', 'testRenameFile'])
        self.assertEqual(results[4], [''])
    d = self.runScript('ls', ('ls    ../' + self.testDir.basename()), 'ls    *File', 'ls    -a    *File', 'ls    -l    testDirectory')
    d.addCallback((lambda xs: [x.split('\n') for x in xs]))
    return d.addCallback(_check)
