Sort the contents of directories in a comparison test.

Don't think we can rely on ->children returning sorted values.