~ chicken-core (chicken-5) ef1b16e46de584f494db77575259aac43a5caa1f
commit ef1b16e46de584f494db77575259aac43a5caa1f Author: felix <felix@call-with-current-continuation.org> AuthorDate: Mon Aug 4 18:59:57 2025 +0100 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Mon Aug 4 18:59:57 2025 +0100 remove backslash nonsense from tests diff --git a/tests/executable-tests.scm b/tests/executable-tests.scm index 52074e59..50b8a8b9 100644 --- a/tests/executable-tests.scm +++ b/tests/executable-tests.scm @@ -9,10 +9,7 @@ (chicken string)) (define program-path - (cond-expand - ((and windows (not cygwin)) - (string-translate (car (command-line-arguments)) "/" "\\")) - (else (car (command-line-arguments))))) + (car (command-line-arguments))) (define (read-symbolic-link* p) (cond-expand diff --git a/tests/file-access-tests.scm b/tests/file-access-tests.scm index 761bb5c9..4fed3aa6 100644 --- a/tests/file-access-tests.scm +++ b/tests/file-access-tests.scm @@ -7,7 +7,7 @@ (import (chicken file) (chicken process-context)) -(define / (car (command-line-arguments))) +(define / "/") (define // (string-append / /)) (define /// (string-append / / /)) diff --git a/tests/path-tests.scm b/tests/path-tests.scm index 8160b63d..d9b22ae3 100644 --- a/tests/path-tests.scm +++ b/tests/path-tests.scm @@ -24,8 +24,6 @@ (test "." (normalize-pathname "" 'unix)) (test "." (normalize-pathname "" 'windows)) -(test "\\..\\" (normalize-pathname "/../" 'windows)) -(test "\\" (normalize-pathname "/abc/../." 'windows)) (test "/" (normalize-pathname "/" 'unix)) (test "/" (normalize-pathname "/." 'unix)) (test "/" (normalize-pathname "/./" 'unix)) @@ -37,30 +35,28 @@ (test "a/" (normalize-pathname "a/" 'unix)) (test "a/b" (normalize-pathname "a/b" 'unix)) (test "a\\b" (normalize-pathname "a\\b" 'unix)) -(test "a\\b" (normalize-pathname "a\\b" 'windows)) -(test "a\\b" (normalize-pathname "a/b" 'windows)) (test "a/b/" (normalize-pathname "a/b/" 'unix)) (test "a/b/" (normalize-pathname "a/b//" 'unix)) (test "a/b" (normalize-pathname "a//b" 'unix)) (test "/a/b" (normalize-pathname "/a//b" 'unix)) (test "/a/b" (normalize-pathname "///a//b" 'unix)) -(test "c:a\\b" (normalize-pathname "c:a/./b" 'windows)) +(test "c:a/b" (normalize-pathname "c:a/./b" 'windows)) (test "c:/a/b" (normalize-pathname "c:/a/./b" 'unix)) -(test "c:a\\b" (normalize-pathname "c:a/./b" 'windows)) +(test "c:a/b" (normalize-pathname "c:a/./b" 'windows)) (test "c:b" (normalize-pathname "c:a/../b" 'windows)) -(test "c:\\b" (normalize-pathname "c:\\a\\..\\b" 'windows)) +(test "c:/b" (normalize-pathname "c:/a/../b" 'windows)) (test "a/b" (normalize-pathname "a/./././b" 'unix)) (test "a/b" (normalize-pathname "a/b/c/d/../.." 'unix)) (test "a/b/" (normalize-pathname "a/b/c/d/../../" 'unix)) (test "../../foo" (normalize-pathname "../../foo" 'unix)) -(test "c:\\" (normalize-pathname "c:\\" 'windows)) -(test "c:\\" (normalize-pathname "c:\\." 'windows)) -(test "c:\\" (normalize-pathname "c:\\.\\" 'windows)) -(test "c:\\" (normalize-pathname "c:\\.\\." 'windows)) +(test "c:/" (normalize-pathname "c:/" 'windows)) +(test "c:/" (normalize-pathname "c:/." 'windows)) +(test "c:/" (normalize-pathname "c:/./" 'windows)) +(test "c:/" (normalize-pathname "c:/./." 'windows)) (test "~/foo" (normalize-pathname "~/foo" 'unix)) (test "c:~/foo" (normalize-pathname "c:~/foo" 'unix)) -(test "c:~\\foo" (normalize-pathname "c:~\\foo" 'windows)) +(test "c:~/foo" (normalize-pathname "c:~/foo" 'windows)) (assert (directory-null? "/.//")) (assert (directory-null? "")) @@ -82,139 +78,57 @@ (test '(#f #f #f) (receive (decompose-pathname ""))) (test '("/" #f #f) (receive (decompose-pathname "/"))) -(if ##sys#windows-platform - (test '("\\" #f #f) (receive (decompose-pathname "\\"))) - (test '(#f "\\" #f) (receive (decompose-pathname "\\")))) - (test '("/" "a" #f) (receive (decompose-pathname "/a"))) -(if ##sys#windows-platform - (test '("\\" "a" #f) (receive (decompose-pathname "\\a"))) - (test '(#f "\\a" #f) (receive (decompose-pathname "\\a")))) - (test '("/" #f #f) (receive (decompose-pathname "///"))) -(if ##sys#windows-platform - (test '("\\" #f #f) (receive (decompose-pathname "\\\\\\"))) - (test '(#f "\\\\\\" #f) (receive (decompose-pathname "\\\\\\")))) - (test '("/" "a" #f) (receive (decompose-pathname "///a"))) -(if ##sys#windows-platform - (test '("\\" "a" #f) (receive (decompose-pathname "\\\\\\a"))) - (test '(#f "\\\\\\a" #f) (receive (decompose-pathname "\\\\\\a")))) - (test '("/a" "b" #f) (receive (decompose-pathname "/a/b"))) -(if ##sys#windows-platform - (test '("\\a" "b" #f) (receive (decompose-pathname "\\a\\b"))) - (test '(#f "\\a\\b" #f) (receive (decompose-pathname "\\a\\b")))) - (test '("/a" "b" "c") (receive (decompose-pathname "/a/b.c"))) -(if ##sys#windows-platform - (test '("\\a" "b" "c") (receive (decompose-pathname "\\a\\b.c"))) - (test '(#f "\\a\\b" "c") (receive (decompose-pathname "\\a\\b.c")))) - (test '("." "a" #f) (receive (decompose-pathname "./a"))) -(if ##sys#windows-platform - (test '("." "a" #f) (receive (decompose-pathname ".\\a"))) - (test '(#f ".\\a" #f) (receive (decompose-pathname ".\\a")))) - (test '("." "a" "b") (receive (decompose-pathname "./a.b"))) -(if ##sys#windows-platform - (test '("." "a" "b") (receive (decompose-pathname ".\\a.b"))) - (test '(#f ".\\a" "b") (receive (decompose-pathname ".\\a.b")))) - (test '("./a" "b" #f) (receive (decompose-pathname "./a/b"))) -(if ##sys#windows-platform - (test '(".\\a" "b" #f) (receive (decompose-pathname ".\\a\\b"))) - (test '(#f ".\\a\\b" #f) (receive (decompose-pathname ".\\a\\b")))) - (test '(#f "a" #f) (receive (decompose-pathname "a"))) (test '(#f "a." #f) (receive (decompose-pathname "a."))) (test '(#f ".a" #f) (receive (decompose-pathname ".a"))) (test '("a" "b" #f) (receive (decompose-pathname "a/b"))) -(if ##sys#windows-platform - (test '("a" "b" #f) (receive (decompose-pathname "a\\b"))) - (test '(#f "a\\b" #f) (receive (decompose-pathname "a\\b")))) - (test '("a" "b" #f) (receive (decompose-pathname "a///b"))) -(if ##sys#windows-platform - (test '("a" "b" #f) (receive (decompose-pathname "a\\\\\\b"))) - (test '(#f "a\\\\\\b" #f) (receive (decompose-pathname "a\\\\\\b")))) - (test '("a/b" "c" #f) (receive (decompose-pathname "a/b/c"))) -(if ##sys#windows-platform - (test '("a\\b" "c" #f) (receive (decompose-pathname "a\\b\\c"))) - (test '(#f "a\\b\\c" #f) (receive (decompose-pathname "a\\b\\c")))) - (test '("a/b/c" #f #f) (receive (decompose-pathname "a/b/c/"))) -(if ##sys#windows-platform - (test '("a\\b\\c" #f #f) (receive (decompose-pathname "a\\b\\c\\"))) - (test '(#f "a\\b\\c\\" #f) (receive (decompose-pathname "a\\b\\c\\")))) - (test '("a/b/c" #f #f) (receive (decompose-pathname "a/b/c///"))) -(if ##sys#windows-platform - (test '("a\\b\\c" #f #f) (receive (decompose-pathname "a\\b\\c\\\\\\"))) - (test '(#f "a\\b\\c\\\\\\" #f) (receive (decompose-pathname "a\\b\\c\\\\\\")))) - (test '(#f "a" "b") (receive (decompose-pathname "a.b"))) (test '("a.b" #f #f) (receive (decompose-pathname "a.b/"))) -(if ##sys#windows-platform - (test '("a.b" #f #f) (receive (decompose-pathname "a.b\\"))) - (test '(#f "a" "b\\") (receive (decompose-pathname "a.b\\")))) - (test '(#f "a.b" "c") (receive (decompose-pathname "a.b.c"))) (test '(#f "a." "b") (receive (decompose-pathname "a..b"))) (test '(#f "a.." "b") (receive (decompose-pathname "a...b"))) (test '("a." ".b" #f) (receive (decompose-pathname "a./.b"))) -(if ##sys#windows-platform - (test '("a." ".b" #f) (receive (decompose-pathname "a.\\.b"))) - (test '(#f "a.\\" "b") (receive (decompose-pathname "a.\\.b")))) - -(cond (##sys#windows-platform - (test "x/y\\z.q" (make-pathname "x/y" "z" "q")) - (test "x/y\\z.q" (make-pathname "x/y" "z.q")) - (test "x/y\\z.q" (make-pathname "x/y/" "z.q")) - (test "x/y\\z.q" (make-pathname "x/y/" "z.q")) - (test "x/y\\z.q" (make-pathname "x/y\\" "z.q")) - (test "x//y\\z.q" (make-pathname "x//y/" "z.q")) - (test "x\\y\\z.q" (make-pathname "x\\y" "z.q"))) - (else (test "x/y/z.q" (make-pathname "x/y" "z" "q")) (test "x/y/z.q" (make-pathname "x/y" "z.q")) (test "x/y/z.q" (make-pathname "x/y/" "z.q")) (test "x/y/z.q" (make-pathname "x/y/" "z.q")) (test "x/y\\/z.q" (make-pathname "x/y\\" "z.q")) (test "x//y/z.q" (make-pathname "x//y/" "z.q")) - (test "x\\y/z.q" (make-pathname "x\\y" "z.q")))) + (test "x\\y/z.q" (make-pathname "x\\y" "z.q")) (test 'error (handle-exceptions _ 'error (make-pathname '(#f) "foo"))) (test "/x/y/z" (make-pathname #f "/x/y/z")) - -(cond (##sys#windows-platform - (test "\\x/y/z" (make-pathname "/" "x/y/z")) - (test "/x\\y/z" (make-pathname "/x" "/y/z")) - (test "\\x/y/z" (make-pathname '("/") "x/y/z")) - (test "\\x\\y/z" (make-pathname '("/" "x") "y/z")) - (test "/x\\y\\z" (make-pathname '("/x" "y") "z")) - (test "/x\\y\\z\\" (make-pathname '("/x" "y" "z") #f))) - (else (test "/x/y/z" (make-pathname "/" "x/y/z")) (test "/x/y/z" (make-pathname "/x" "/y/z")) (test "/x/y/z" (make-pathname '("/") "x/y/z")) (test "/x/y/z" (make-pathname '("/" "x") "y/z")) (test "/x/y/z" (make-pathname '("/x" "y") "z")) - (test "/x/y/z/" (make-pathname '("/x" "y" "z") #f)))) + (test "/x/y/z/" (make-pathname '("/x" "y" "z") #f)) diff --git a/tests/runtests.sh b/tests/runtests.sh index 1dea4d28..c3ad34a7 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -434,12 +434,7 @@ $compile posix-tests.scm ./a.out echo "======================================== file access tests ..." -if test -n "$MSYSTEM"; then - $interpret -s file-access-tests.scm // - $interpret -s file-access-tests.scm \\ -else - $interpret -s file-access-tests.scm / -fi +$interpret -s file-access-tests.scm echo "======================================== find-files tests ..." $interpret -bnq test-find-files.scm diff --git a/tests/test-find-files.scm b/tests/test-find-files.scm index 4aa7c772..f69f2db8 100644 --- a/tests/test-find-files.scm +++ b/tests/test-find-files.scm @@ -30,11 +30,11 @@ (cond-expand ((and windows (not cygwin)) ; Cannot handle symlinks - (define (path lst) - (map (cut string-translate <> "/" "\\") lst)) ) + #f ) (else - (create-symbolic-link "dir-link-target" "dir-link-name") - (define (path lst) lst))) + (create-symbolic-link "dir-link-target" "dir-link-name"))) + +(define (path lst) lst) (test-begin "find-files")Trap