Fix test so that it doesn't depend on file iteration order