0.8.8.8:
[sbcl.git] / contrib / sb-posix / posix-tests.lisp
index 647af23..469b739 100644 (file)
     (let ((*default-pathname-defaults* *test-directory*))
       (sb-posix:unlink (car (directory "*.txt")))))
   0)
-                        
+\f
+(deftest open.1
+  (let ((fd (sb-posix:open *test-directory* sb-posix::o-rdonly)))
+    (ignore-errors (sb-posix:close fd))
+    (< fd 0))
+  nil)
+
+(deftest open.error.1
+  (handler-case (sb-posix:open *test-directory* sb-posix::o-wronly)
+    (sb-posix:syscall-error (c)
+      (sb-posix:syscall-errno c)))
+  #.sb-posix::eisdir)
+
+(deftest fcntl.1
+  (let ((fd (sb-posix:open "/dev/null" sb-posix::o-nonblock)))
+    (= (sb-posix:fcntl fd sb-posix::f-getfl) sb-posix::o-nonblock))
+  t)