file-reparent.lisp 1.2 KB

123456789101112131415161718192021222324
  1. (in-package :translator-test)
  2. (def-test-method file-reparent-test ((test fs-test))
  3. (let ((dir1-name (concatenate-string +translator-root+
  4. "/root/dir1"))
  5. (root-name (concatenate-string +translator-root+
  6. "/root")))
  7. (with-testport (p-root (file-name-lookup +translator-root+))
  8. (with-testport (p-dir1 (file-name-lookup dir1-name))
  9. (with-testport (p-root-dir (file-name-lookup root-name))
  10. (let ((root-stat (io-stat p-root)))
  11. (with-testport (p-reparent (file-reparent p-dir1 p-root))
  12. (with-testport (mustberoot (file-name-lookup ".."
  13. :under p-reparent))
  14. (assert-true (stat-eq root-stat
  15. (io-stat mustberoot)))
  16. (assert-true (not (stat-eq (io-stat p-root-dir)
  17. (io-stat mustberoot))))
  18. (with-testport (oldparent (file-name-lookup ".."
  19. :under p-dir1))
  20. (assert-true (not (stat-eq (io-stat oldparent)
  21. (io-stat mustberoot)))))))))))))