io-openmodes.lisp 795 B

123456789101112131415161718
  1. (in-package :translator-test)
  2. (def-test-method io-openmodes-test ((test io-test))
  3. (with-testport (p (file-name-lookup (concatenate-string +translator-root+
  4. "/root/a") :flags '(:read)))
  5. (assert-equal '(:read) (io-get-openmodes p))
  6. (assert-true (io-set-some-openmodes p '(:nonblock)))
  7. (assert-equal '(:nonblock :read)
  8. (io-get-openmodes p))
  9. (assert-true (io-set-all-openmodes p '(:append :async :fsync)))
  10. (assert-equal '(:fsync :async :append :read) (io-get-openmodes p))
  11. (assert-true (io-clear-some-openmodes p '(:append :fsync)))
  12. (assert-equal '(:async :read) (io-get-openmodes p))
  13. (assert-true (io-set-all-openmodes p '()))
  14. (assert-equal '(:read) (io-get-openmodes p))))