commit 41b04c85eef31d4d51001c6d66e8fd339fcc614c
parent 9476b2e92ce88368b64e79a7d17e0849ac07a460
Author: Yuval Langer <yuval.langer@gmail.com>
Date: Tue, 6 Feb 2024 13:26:02 +0200
Add Zipheir acknowledgements and put tests in main procedures.
Diffstat:
3 files changed, 61 insertions(+), 43 deletions(-)
diff --git a/README.md b/README.md
@@ -47,6 +47,11 @@ The [example RSV test files](./TestFiles/) came from [commit
release under the [MIT-0][8] license. The exact copyright notice can
be found in the [LICENSE file](./TestFiles/LICENSE).
+## Acknowledgements:
+
+Written with the help and direction of [Zipheir (Wolfgang
+Corcoran-Mathe)][zipheir] of #scheme @ libera.chat.
+
[1]: https://github.com/Stenway/RSV-Specification
[2]: https://www.youtube.com/watch?v=tb_70o6ohMA
[3]: https://codeberg.org/kakafarm/guile-rsv/
diff --git a/tests-rows-streams.scm b/tests-rows-streams.scm
@@ -1,3 +1,7 @@
+#!/usr/bin/env sh
+exec guile --r7rs -e main -L . -s "$0" "$@"
+!#
+
;;; Scheme implementation of RSV - Rows of String Values.
;;; Copyright (C) 2024 Yuval Langer.
;;;
@@ -27,6 +31,7 @@
(rsv)
(rsv rows-streams))
+ (export main)
(begin
(define valid-filenames
@@ -98,26 +103,27 @@
(test-equal original-rsv (back-and-forth original-rsv)))
#:count-calls? #t))
- (test-begin "rsv-rows-streams-tests")
-
- (for-each (lambda (filename)
- (write filename) (newline)
- (call-with-input-file filename
- (lambda (port)
- (test-group filename
- (let ((original-rsv (get-bytevector-all port)))
- (display 'run-stream-back-and-forth-failing-test) (newline)
- (run-stream-back-and-forth-failing-test original-rsv))))))
- invalid-filenames)
-
- (for-each (lambda (filename)
- (write filename) (newline)
- (call-with-input-file filename
- (lambda (port)
- (test-group filename
- (let ((original-rsv (get-bytevector-all port)))
- (display 'run-stream-back-and-forth-test) (newline)
- (run-stream-back-and-forth-test original-rsv))))))
- valid-filenames)
-
- (test-end "rsv-rows-streams-tests")))
+ (define (main args)
+ (test-begin "rsv-rows-streams-tests")
+
+ (for-each (lambda (filename)
+ (write filename) (newline)
+ (call-with-input-file filename
+ (lambda (port)
+ (test-group filename
+ (let ((original-rsv (get-bytevector-all port)))
+ (display 'run-stream-back-and-forth-failing-test) (newline)
+ (run-stream-back-and-forth-failing-test original-rsv))))))
+ invalid-filenames)
+
+ (for-each (lambda (filename)
+ (write filename) (newline)
+ (call-with-input-file filename
+ (lambda (port)
+ (test-group filename
+ (let ((original-rsv (get-bytevector-all port)))
+ (display 'run-stream-back-and-forth-test) (newline)
+ (run-stream-back-and-forth-test original-rsv))))))
+ valid-filenames)
+
+ (test-end "rsv-rows-streams-tests"))))
diff --git a/tests.scm b/tests.scm
@@ -1,3 +1,7 @@
+#!/usr/bin/env sh
+exec guile --r7rs -e main -L . -s "$0" "$@"
+!#
+
;;; Scheme implementation of RSV - Rows of String Values.
;;; Copyright (C) 2024 Yuval Langer.
;;;
@@ -25,6 +29,7 @@
(statprof)
(rsv))
+ (export main)
(begin
(define valid-filenames
@@ -93,26 +98,28 @@
(scm->rsv-bytevector (rsv-bytevector->scm original-rsv))))
#:count-calls? #t))
- (test-begin "rsv-tests")
+ (define (main args)
+
+ (test-begin "rsv-tests")
- (for-each (lambda (filename)
- (write filename) (newline)
- (call-with-input-file filename
- (lambda (port)
- (test-group filename
- (let ((original-rsv (get-bytevector-all port)))
- (display 'run-back-and-forth-failing-test) (newline)
- (run-back-and-forth-failing-test original-rsv))))))
- invalid-filenames)
+ (for-each (lambda (filename)
+ (write filename) (newline)
+ (call-with-input-file filename
+ (lambda (port)
+ (test-group filename
+ (let ((original-rsv (get-bytevector-all port)))
+ (display 'run-back-and-forth-failing-test) (newline)
+ (run-back-and-forth-failing-test original-rsv))))))
+ invalid-filenames)
- (for-each (lambda (filename)
- (write filename) (newline)
- (call-with-input-file filename
- (lambda (port)
- (test-group filename
- (let ((original-rsv (get-bytevector-all port)))
- (display 'run-back-and-forth-test) (newline)
- (run-back-and-forth-test original-rsv))))))
- valid-filenames)
+ (for-each (lambda (filename)
+ (write filename) (newline)
+ (call-with-input-file filename
+ (lambda (port)
+ (test-group filename
+ (let ((original-rsv (get-bytevector-all port)))
+ (display 'run-back-and-forth-test) (newline)
+ (run-back-and-forth-test original-rsv))))))
+ valid-filenames)
- (test-end "rsv-tests")))
+ (test-end "rsv-tests"))))