dir-link.lisp 947 B

12345678910111213141516171819202122
  1. (in-package :translator-test)
  2. (def-test-method dir-link-test ((test fs-test))
  3. (with-testport (dir (file-name-lookup +main-dir+))
  4. (with-testport (file (file-name-lookup (concatenate-string +main-dir+
  5. "/a")))
  6. (assert-true (dir-link dir :file file :name "mylink"))
  7. (with-testport (test (file-name-lookup (concatenate-string +main-dir+
  8. "/mylink"))))
  9. (assert-true (dir-unlink dir "mylink"))
  10. (multiple-value-bind (ret err)
  11. (dir-link dir :file file :name "a" :excl t)
  12. (declare (ignore ret))
  13. (assert-equal :file-exists err))
  14. (with-testport (file2 (file-name-lookup "/usr"))
  15. (multiple-value-bind (ret err)
  16. (dir-link dir :file file2 :name "abc" :excl t)
  17. (declare (ignore ret))
  18. (assert-equal :invalid-cross-device-link err))))))