From eeeeef9a9531deee540f57f37ab292f95fc624bb Mon Sep 17 00:00:00 2001 From: Mustafa Date: Tue, 4 Mar 2014 12:04:13 -0800 Subject: [PATCH] added test --- sosc/bytevector.rkt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sosc/bytevector.rkt b/sosc/bytevector.rkt index 191533e..c54a37c 100644 --- a/sosc/bytevector.rkt +++ b/sosc/bytevector.rkt @@ -73,20 +73,19 @@ (module+ test (require rackunit) + ;; test bytevector-section, which is equivalent ot subbytes (test-begin (let [(long-vec (bytes 10 20 30 40 50))] (check-equal? (bytevector-section long-vec 0 2) (bytes 10 20)) (check-equal? (bytevector-section long-vec 0 (bytes-length long-vec)) long-vec) - ;; bytevector-section is equivalent ot subbytes (check-equal? (bytevector-section long-vec 1 3) (subbytes long-vec 1 3)) - ; check if exceding limits raises exception (check-exn exn:fail? (λ () (bytevector-section long-vec 0 30))) - (check-exn exn:fail? (λ () (bytevector-section long-vec -1 3))) - ) - ) - ) \ No newline at end of file + (check-exn exn:fail? (λ () (bytevector-section long-vec -1 3))))) + + (check-equal? (flatten-bytevectors (list (bytes 10 20) (bytes 30 40) (list (bytes 50 60)))) + (bytes 10 20 30 40 50 60))) \ No newline at end of file