fix mapdir tests master
authorNicolas Martyanoff <khaelin@gmail.com>
Wed, 22 Feb 2012 06:56:48 +0000 (07:56 +0100)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 30 Mar 2012 14:39:29 +0000 (17:39 +0300)
Reading the files in a directory yields filenames in an undefined order. The
returned list needs to be sorted to make sure we always get the same order.

tests/osicat.lisp

index 4f38173..f892192 100644 (file)
            (subdir (ensure-directories-exist
                     (merge-pathnames "subdir/" dir))))
       (unwind-protect
-           (remove-if #'null (mapdir #'pathname-name dir))
+           (let ((result (remove-if #'null (mapdir #'pathname-name dir))))
+             (sort result #'string<))
         (osicat-posix:unlink file1)
         (osicat-posix:unlink file2)
         (delete-directory subdir)
            (subdir (ensure-directories-exist
                     (merge-pathnames "subdir/" dir))))
       (unwind-protect
-           (sort (mapdir #'namestring dir) #'string<)
+           (let ((result (mapdir #'namestring dir)))
+             (sort result #'string<))
         (osicat-posix:unlink file1)
         (osicat-posix:unlink file2)
         (delete-directory subdir)