Ignore:
Timestamp:
10/29/08 03:17:33 (13 years ago)
Author:
Ivan Raikov
Message:

Completed porting the test cases from FilePath?.hs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/filepath/trunk/tests/run.scm

    r12289 r12291  
    209209
    210210
    211 
     211(define is-valid-posix-tests
     212  `(("/random_ path:*" #t)))
     213
     214(define is-valid-windows-tests
     215 `(( "c:\\test" #t)
     216   ( "c:\\test:of_test" #f)
     217   ( "test*" #f)
     218   ( "c:\\test\\nul" #f)
     219   ( "c:\\test\\prn.txt" #f)
     220   ( "c:\\nul\\file" #f)))
     221
     222
     223(test-group "is-valid?"
     224            (filepath:posix #f)
     225            (for-each (lambda (pr)
     226                        (let ((p (first pr)) (res (second pr)))
     227                          (test (sprintf "~S => ~S" (list 'is-valid? p) res)
     228                                res (filepath:is-valid? p))))
     229                      is-valid-windows-tests)
     230            (filepath:posix #t)
     231            (for-each (lambda (pr)
     232                        (let ((p (first pr)) (res (second pr)))
     233                          (test (sprintf "~S => ~S" (list 'is-valid? p) res)
     234                                res (filepath:is-valid? p))))
     235                      is-valid-posix-tests))
     236
     237(define make-valid-tests
     238  `(("c:\\test:of_test"  "c:\\test_of_test")
     239    ("test*"  "test_")
     240    ("c:\\test\\nul"  "c:\\test\\nul_")
     241    ("c:\\test\\prn.txt"  "c:\\test\\prn_.txt")
     242    ("c:\\test/prn.txt"  "c:\\test/prn_.txt")
     243    ("c:\\nul\\file"  "c:\\nul_\\file")))
     244
     245
     246(test-group "make-valid"
     247            (filepath:posix #f)
     248            (for-each (lambda (pr)
     249                        (let ((p (first pr)) (res (second pr)))
     250                          (test (sprintf "~S => ~S" (list 'make-valid p) res)
     251                                res (filepath:make-valid p))))
     252                      make-valid-tests)
     253            (filepath:posix #t)
     254            )
Note: See TracChangeset for help on using the changeset viewer.