file-symlink.lisp 989 B

123456789101112131415161718192021
  1. (in-package :translator-test)
  2. (def-test-method file-symlink-test ((test fs-test))
  3. "This does the same thing as symlink.c from glibc."
  4. (with-testport (p (file-name-lookup +main-dir+))
  5. (with-testport (file (dir-mkfile p
  6. :flags '(:write)
  7. :mode (make-mode :perms '((:owner :read :write :exec)
  8. (:group :read :write :exec)
  9. (:others :read :write :exec)))))
  10. (assert-true (file-set-translator file
  11. :path (list +hurd-symlink+ "/usr")))
  12. (assert-true (dir-link p
  13. :file file
  14. :name "mylink"
  15. :excl t))
  16. (assert-equal (file-get-translator file)
  17. (list +hurd-symlink+ "/usr"))
  18. (assert-true (dir-unlink p "mylink")))))