Changeset 10021


Ignore:
Timestamp:
09/24/05 18:04:07 (16 years ago)
Author:
piso
Message:

Work in progress.

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/pathnames.lisp

    r10006 r10021  
    22;;;
    33;;; Copyright (C) 2003-2005 Peter Graves
    4 ;;; $Id: pathnames.lisp,v 1.25 2005-09-22 23:34:42 piso Exp $
     4;;; $Id: pathnames.lisp,v 1.26 2005-09-24 18:04:07 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    4545        ((null wild)
    4646         t)
     47        ((and (stringp wild) (position #\* wild))
     48         (error "Unsupported wildcard pattern: ~S" wild))
    4749        (ignore-case
    4850         (equalp thing wild))
     
    165167         ;; result."
    166168         ;; FIXME
    167          (error "Unsupported TO-WILDCARD pattern: ~S" to))))
     169         (error "Unsupported wildcard pattern: ~S" to))))
    168170
    169171(defun translate-directory-components (source from to case)
  • trunk/j/src/org/armedbear/lisp/tests/pathname-tests.lisp

    r10020 r10021  
    498498  t)
    499499
    500 #-abcl
    501500;; ABCL doesn't implement this translation.
    502501(deftest translate-pathname.3
     502  #-abcl
    503503  (string= (pathname-name (translate-pathname "foobar" "*" "foo*")) "foofoobar")
    504   t)
    505 
     504  #+abcl
     505  (signals-error (translate-pathname "foobar" "*" "foo*") 'error)
     506  t)
     507
     508;; ABCL doesn't implement this translation.
    506509(deftest translate-pathname.4
     510  #-abcl
     511  (equal (translate-pathname "foobar" "foo*" "*baz") #p"barbaz")
     512  #+abcl
     513  (signals-error (translate-pathname "foobar" "foo*" "*baz") 'error)
     514  t)
     515
     516(deftest translate-pathname.5
     517  (equal (translate-pathname "foo/bar" "*/bar" "*/baz") #p"foo/baz")
     518  t)
     519
     520(deftest translate-pathname.6
     521  (equal (translate-pathname "bar/foo" "bar/*" "baz/*") #p"baz/foo")
     522  t)
     523
     524(deftest translate-pathname.7
     525  (equal (translate-pathname "foo/bar" "*/bar" "*/baz") #p"foo/baz")
     526  t)
     527
     528(deftest translate-pathname.8
    507529  (string= (namestring (translate-pathname "test.txt" "*.txt" "*.text"))
    508530           "test.text")
    509531  t)
    510532
    511 (deftest translate-pathname.5
    512   (check-namestring (translate-pathname "foo/bar" "*/bar" "*/baz") "foo/baz")
    513   t)
    514 (deftest translate-pathname.6
    515   (equal (translate-pathname "foo/bar" "*/bar" "*/baz") #p"foo/baz")
    516   t)
    517 (deftest translate-pathname.7
     533(deftest translate-pathname.9
     534  (equal (translate-pathname "foo" "foo.*" "bar") #p"bar")
     535  t)
     536
     537(deftest translate-pathname.10
     538  (equal (translate-pathname "foo" "foo.*" "bar.*") #p"bar")
     539  t)
     540
     541(deftest translate-pathname.11
    518542  (string= (namestring (translate-pathname "foo.bar" "*.*" "/usr/local/*.*"))
    519543           #-windows "/usr/local/foo.bar"
    520544           #+windows "\\usr\\local\\foo.bar")
    521545  t)
    522 (deftest translate-pathname.8
     546
     547(deftest translate-pathname.12
    523548  (equal (translate-pathname "foo.bar" "*.*" "/usr/local/*.*")
    524549         #p"/usr/local/foo.bar")
    525550  t)
    526551
    527 (deftest translate-pathname.9
     552(deftest translate-pathname.13
    528553  (check-translate-pathname '("/foo/" "/*/" "/usr/local/*/") "/usr/local/foo/")
    529554  t)
    530 (deftest translate-pathname.10
     555
     556(deftest translate-pathname.14
    531557  (check-translate-pathname '("/foo/baz/bar.txt" "/**/*.*" "/usr/local/**/*.*")
    532558                            "/usr/local/foo/baz/bar.txt")
    533559  t)
    534560
    535 (deftest translate-pathname.11
     561(deftest translate-pathname.15
    536562  (equal (translate-pathname "/foo/" "/*/" "/usr/local/*/bar/") #p"/usr/local/foo/bar/")
    537563  t)
    538564
    539 (deftest translate-pathname.12
     565(deftest translate-pathname.16
    540566  (equal (translate-pathname "/foo/bar.txt" "/*/*.*" "/usr/local/*/*.*")
    541567         #P"/usr/local/foo/bar.txt")
     
    547573  nil)
    548574;; Since (pathname-match-p "/foo/bar.txt" "**/*.*" ) => NIL...
    549 (deftest translate-pathname.13
     575(deftest translate-pathname.17
    550576  #+(or clisp allegro abcl cmu)
    551577  ;; This seems to be the correct behavior.
     
    560586  (pathname-match-p "/foo/bar.txt" "/**/*.*")
    561587  t)
    562 (deftest translate-pathname.14
     588(deftest translate-pathname.18
    563589  (equal (translate-pathname "/foo/bar.txt" "/**/*.*" "/usr/local/**/*.*")
    564590         #p"/usr/local/foo/bar.txt")
     
    566592
    567593#-clisp
    568 (deftest translate-pathname.15
     594(deftest translate-pathname.19
    569595  (equal (translate-pathname "foo.bar" "/**/*.*" "/usr/local/") #p"/usr/local/foo.bar")
    570596  t)
     
    656682  t)
    657683;;; Check for absolute/relative path confusion.
     684#-allegro
    658685(deftest sbcl.5
    659   (pathname-match-p "demo1:;foo.lisp" "**;*.*.*")
     686  (pathname-match-p "demo1:;foo.lisp" "demo1:**;*.*.*")
    660687  nil)
    661 #+(or sbcl cmu allegro abcl)
     688#+(or sbcl cmu)
    662689;; BUG Pathnames should match if the following translation is to work.
    663690(deftest sbcl.6
     
    9931020  (check-readable-or-signals-error (make-pathname :name "foo" :type "txt" :version :newest))
    9941021  t)
     1022#-allegro
    9951023(deftest sbcl.49
    9961024  (check-readable-or-signals-error (make-pathname :name "foo" :type "txt" :version 1))
    9971025  t)
     1026#-allegro
    9981027(deftest sbcl.50
    9991028  #-clisp
     
    10201049  t)
    10211050
     1051#-allegro
    10221052(deftest sbcl.56
    10231053  (let ((test "parse-namestring-test.tmp"))
     
    10471077  t)
    10481078
     1079#-allegro
    10491080(deftest sbcl.59
    10501081  (string= (with-standard-io-syntax (write-to-string #p"/foo")) "#P\"/foo\"")
    10511082  t)
     1083
     1084#-allegro
    10521085(deftest sbcl.60
    10531086  (string= (with-standard-io-syntax (write-to-string #p"/foo" :readably nil))
    10541087           "#P\"/foo\"")
    10551088  t)
     1089
     1090#-allegro
    10561091(deftest sbcl.61
    10571092  (string= (with-standard-io-syntax (write-to-string #p"/foo" :escape nil))
    10581093           "#P\"/foo\"")
    10591094  t)
     1095
    10601096(deftest sbcl.62
    10611097  (string= (with-standard-io-syntax (write-to-string #p"/foo" :readably nil :escape nil))
Note: See TracChangeset for help on using the changeset viewer.