changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/io/tests.lisp

changeset 698: 96958d3eb5b0
parent: c40d2a41d7ce
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 (defpackage :io/tests
2  (:use :cl :std :rt :io :uring))
3 (in-package :io/tests)
4 (defsuite :io)
5 (in-suite :io)
6 
7 (load-uring)
8 
9 (deftest sanity ()
10  (uring::io-uring-major-version))
11 
12 (deftest serve-event ()
13  "See 'tests/serve-event.pure.lisp'."
14  nil)
15 
16 (deftest compress ())
17 
18 (deftest decompress ())
19 
20 #| test from salza2
21 (defparameter *data-size* (* 10 1024))
22 
23 (define-test compressing-stream
24  "Test the compressing stream by round tripping random data through salza2 and
25 then chipz."
26  (let ((data (make-array *data-size* :element-type '(unsigned-byte 8)
27  :initial-contents (loop :repeat *data-size*
28  :collect (random 256))))
29  (round-trip-data (make-array *data-size* :element-type '(unsigned-byte 8)
30  :initial-element 0))
31  compressed-data)
32  (setf compressed-data
33  (flexi-streams:with-output-to-sequence (wrapped-stream)
34  (with-open-stream
35  (out-stream (salza2:make-compressing-stream 'salza2:gzip-compressor wrapped-stream))
36  (write-sequence data out-stream))))
37  (flexi-streams:with-input-from-sequence (wrapped-stream compressed-data)
38  (with-open-stream
39  (in-stream (chipz:make-decompressing-stream 'chipz:gzip wrapped-stream))
40  (read-sequence round-trip-data in-stream)
41  (is eql :eof (read-byte in-stream nil :eof))))
42  (is equalp data round-trip-data)))
43 
44 (define-test compressing-stream-closed-error
45  (flexi-streams:with-output-to-sequence (wrapped-stream)
46  (let ((out-stream (salza2:make-compressing-stream 'salza2:gzip-compressor wrapped-stream)))
47  (write-byte 1 out-stream)
48  (close out-stream)
49  (fail (write-byte 2 out-stream) 'salza2:stream-closed-error))))
50 |#