~ chicken-core (chicken-5) cd5273c49bc1fd692e062561063648473108749f


commit cd5273c49bc1fd692e062561063648473108749f
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Sat Jun 20 14:36:28 2015 +0200
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Thu Jun 25 09:29:38 2015 +1200

    Skip symlink tests in find-files test on Windows, which can't handle symlinks
    
    Signed-off-by: Evan Hanson <evhan@foldling.org>

diff --git a/tests/test-find-files.scm b/tests/test-find-files.scm
index 891ab925..c3ef3e4d 100644
--- a/tests/test-find-files.scm
+++ b/tests/test-find-files.scm
@@ -23,26 +23,30 @@
 
 (change-directory "find-files-test-dir")
 
-(create-symbolic-link "dir-link-target" "dir-link-name")
+(cond-expand
+  ((and windows (not cygwin)))		; Cannot handle symlinks
+  (else (create-symbolic-link "dir-link-target" "dir-link-name")))
 
 (test-begin "find-files")
 
 (test-equal "no keyword args"
             (find-files ".")
-            '("./foo/bar/baz"
+            `("./foo/bar/baz"
               "./foo/bar"
               "./foo"
               "./dir-link-target/foo"
               "./dir-link-target/bar"
               "./dir-link-target"
               "./file1"
-              "./dir-link-name"
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name")))
               "./file2")
             file-list=?)
 
 (test-equal "dotfiles: #t"
             (find-files "." dotfiles: #t)
-            '("./foo/bar/baz/.quux"
+            `("./foo/bar/baz/.quux"
               "./foo/bar/baz"
               "./foo/bar"
               "./foo/.x"
@@ -51,108 +55,126 @@
               "./dir-link-target/bar"
               "./dir-link-target"
               "./file1"
-              "./dir-link-name"
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name")))
               "./file2")
             file-list=?)
 
 (test-equal "follow-symlinks: #t"
             (find-files "." follow-symlinks: #t)
-            '("./foo/bar/baz"
+            `("./foo/bar/baz"
               "./foo/bar"
               "./foo"
               "./dir-link-target/foo"
               "./dir-link-target/bar"
               "./dir-link-target"
               "./file1"
-              "./dir-link-name/foo"
-              "./dir-link-name/bar"
-              "./dir-link-name"
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name/foo"
+			  "./dir-link-name/bar"
+			  "./dir-link-name")))
               "./file2")
             file-list=?)
 
 (test-equal "limit: 1"
             (find-files "." limit: 1)
-            '("./foo/bar"
+            `("./foo/bar"
               "./foo"
               "./dir-link-target/foo"
               "./dir-link-target/bar"
               "./dir-link-target"
               "./file1"
-              "./dir-link-name"
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name")))
               "./file2")
             file-list=?)
 
 (test-equal "limit: 1 follow-symlinks: #t"
             (find-files "." limit: 1 follow-symlinks: #t)
-            '("./foo/bar"
+            `("./foo/bar"
               "./foo"
               "./dir-link-target/foo"
               "./dir-link-target/bar"
               "./dir-link-target"
               "./file1"
-              "./dir-link-name/foo"
-              "./dir-link-name/bar"
-              "./dir-link-name"
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name/foo"
+			  "./dir-link-name/bar"
+			  "./dir-link-name")))
               "./file2")
             file-list=?)
 
 (test-equal "limit: 2"
             (find-files "." limit: 2)
-            '("./foo/bar/baz"
+            `("./foo/bar/baz"
               "./foo/bar"
               "./foo"
               "./dir-link-target/foo"
               "./dir-link-target/bar"
               "./dir-link-target"
               "./file1"
-              "./dir-link-name"
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name")))
               "./file2")
             file-list=?)
 
 (test-equal "limit: 2 follow-symlinks: #t"
             (find-files "." limit: 2 follow-symlinks: #t)
-            '("./foo/bar/baz"
+            `("./foo/bar/baz"
               "./foo/bar"
               "./foo"
               "./dir-link-target/foo"
               "./dir-link-target/bar"
               "./dir-link-target"
               "./file1"
-              "./dir-link-name/foo"
-              "./dir-link-name/bar"
-              "./dir-link-name"
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name/foo"
+			  "./dir-link-name/bar"
+			  "./dir-link-name")))
               "./file2")
             file-list=?)
 
 (test-equal "test: (lambda (f) (directory? f))"
             (find-files "." test: (lambda (f) (directory? f)))
-            '("./foo/bar/baz"
+            `("./foo/bar/baz"
               "./foo/bar"
               "./foo"
               "./dir-link-target"
-              "./dir-link-name")
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name"))))
             file-list=?)
 
 (test-equal "test: (lambda (f) (directory? f)) action: (lambda (f p) (cons (string-append \"--\" f) p))"
             (find-files "."
                         test: (lambda (f) (directory? f))
                         action: (lambda (f p) (cons (string-append "--" f) p)))
-            '("--./foo/bar/baz"
+            `("--./foo/bar/baz"
               "--./foo/bar"
               "--./foo"
               "--./dir-link-target"
-              "--./dir-link-name")
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("--./dir-link-name"))))
             file-list=?)
 
 (test-equal "dotfiles: #t test: (lambda (f) (directory? f)) follow-symlinks: #t"
             (find-files "." dotfiles: #t test: (lambda (f) (directory? f)) follow-symlinks: #t)
-            '("./foo/bar/baz/.quux"
+            `("./foo/bar/baz/.quux"
               "./foo/bar/baz"
               "./foo/bar"
               "./foo/.x"
               "./foo"
               "./dir-link-target"
-              "./dir-link-name")
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name"))))
             file-list=?)
 
 (test-equal "dotfiles: #t test: (lambda (f) (directory? f)) follow-symlinks: #t limit: 1"
@@ -161,11 +183,13 @@
                         test: (lambda (f) (directory? f))
                         follow-symlinks: #t
                         limit: 1)
-            '("./foo/bar"
+            `("./foo/bar"
               "./foo/.x"
               "./foo"
               "./dir-link-target"
-              "./dir-link-name")
+	      ,@(cond-expand
+		  ((and windows (not cygwin)) '())
+		  (else '("./dir-link-name"))))
             file-list=?)
 
 (test-end "find-files")
Trap