;;; Time-stamp: <06/02/05 20:42:28 noel>
;;; Copyright (C) 2005 by Noel Welsh.

;;; This library is free software; you can redistribute it
;;; and/or modify it under the terms of the GNU Lesser
;;; General Public License as published by the Free Software
;;; Foundation; either version 2.1 of the License, or (at
;;; your option) any later version.

;;; This library is distributed in the hope that it will be
;;; useful, but WITHOUT ANY WARRANTY; without even the
;;; implied warranty of MERCHANTABILITY or FITNESS FOR A
;;; PARTICULAR PURPOSE.  See the GNU Lesser General Public
;;; License for more details.

;;; You should have received a copy of the GNU Lesser
;;; General Public License along with this library; if not,
;;; write to the Free Software Foundation, Inc., 59 Temple
;;; Place, Suite 330, Boston, MA 02111-1307 USA

;;; Author: Noel Welsh <>
;; Commentary:
(module file-test mzscheme
  (require (planet "" ("schematics" "schemeunit.plt" 2)))
  (require "")
  (provide file-tests)
  (define file-tests
     "All tests for file"
      "make-directory-tree creates single directory"
      (check-false (directory-exists? "testing"))
      (make-directory-tree "testing")
      (check-true (directory-exists? "testing"))
      (delete-directory "testing"))

      "make-directory-tree creates list of directories"
      (let ((dirs '("t1" "t2" "t3")))
        (map (lambda (dir)
               (check-false (directory-exists? dir)))
        (make-directory-tree dirs)
        (map (lambda (dir)
               (check-true (directory-exists? dir)))
        (map delete-directory dirs)))

      "make-directory-tree creates tree of directories"
      (check-false (directory-exists? "a"))
      (check-false (directory-exists? "a/b"))
      (check-false (directory-exists? "a/c"))
      (check-false (directory-exists? "a/c/d"))
      (make-directory-tree '("a" ("b" "c" ("d"))))
      (check-true (directory-exists? "a"))
      (check-true (directory-exists? "a/b"))
      (check-true (directory-exists? "a/c"))
      (check-true (directory-exists? "a/c/d"))
      (delete-directory "a/c/d")
      (delete-directory "a/c")
      (delete-directory "a/b")
      (delete-directory "a"))