Commits

David Krentzlin committed 171cbc7

refactord better testing code

  • Participants
  • Parent commits b58aac9

Comments (0)

Files changed (1)

tests/test-helper.scm

        (read-line server-input)))))
 
 ;generate a string of bytes bytes
-(define (with-buffer bytes proc)
+(define (call-with-buffer bytes proc)
   (proc (make-string bytes #\a)))
 
+(define (call-with-buffer/checksum buffer-size proc)
+  (call-with-buffer
+   buffer-size
+   (lambda (buffer)
+     (proc buffer (buffer-checksum buffer)))))
+
 ;; generate files
 (define (call-with-temporary-file content proc)
   (let ((path (create-temporary-file)))
   (* amount 1024))
 
 (define (generate-buffer bytes)
-  (with-buffer bytes identity))
+  (call-with-buffer bytes identity))