file-chown.lisp 601 B

1234567891011121314151617
  1. (in-package :translator-test)
  2. (def-test-method file-chown-test ((test fs-test))
  3. (with-testport (p (file-name-lookup +translator-root+))
  4. (let ((stat (io-stat p)))
  5. (assert-equal 0 (stat-get stat 'st-uid))
  6. (assert-equal 0 (stat-get stat 'st-gid))
  7. (assert-true (file-chown p 101 102))
  8. (setf stat (io-stat p))
  9. (assert-equal 101 (stat-get stat 'st-uid))
  10. (assert-equal 102 (stat-get stat 'st-gid))
  11. (assert-true (file-chown p 0 0))
  12. (setf stat (io-stat p))
  13. (assert-equal 0 (stat-get stat 'st-uid))
  14. (assert-equal 0 (stat-get stat 'st-gid)))))