[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.1-102-gdfc4d
From: |
Andreas Rottmann |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.1-102-gdfc4d56 |
Date: |
Fri, 27 May 2011 12:54:39 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=dfc4d56df1854e1c93606fa03497ff7218357e3d
The branch, stable-2.0 has been updated
via dfc4d56df1854e1c93606fa03497ff7218357e3d (commit)
from c382f58943a80cc9467695b3f2399407bcf7e1bf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit dfc4d56df1854e1c93606fa03497ff7218357e3d
Author: Andreas Rottmann <address@hidden>
Date: Fri May 27 14:48:31 2011 +0200
Add some tests for the R6RS I/O libraries
* test-suite/tests/r6rs-ports.test
(call-with-bytevector-output-port/transcoded): New helper procedure.
("8.2.6 Input and output ports"): Use that helper procedure.
(encoding-error-predicate): New helper procedure.
("8.2.12 Textual Output"): Add tests for `put-char' and `put-string'
exception behavior on encoding errors.
-----------------------------------------------------------------------
Summary of changes:
test-suite/tests/r6rs-ports.test | 36 ++++++++++++++++++++++++++++++------
1 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/test-suite/tests/r6rs-ports.test b/test-suite/tests/r6rs-ports.test
index 7a382b7..feef48d 100644
--- a/test-suite/tests/r6rs-ports.test
+++ b/test-suite/tests/r6rs-ports.test
@@ -72,6 +72,12 @@
(lambda () #t)) ;; close-port
"rw")))
+(define (call-with-bytevector-output-port/transcoded transcoder receiver)
+ (call-with-bytevector-output-port
+ (lambda (bv-port)
+ (call-with-port (transcoded-port bv-port transcoder)
+ receiver))))
+
(with-test-prefix "7.2.5 End-of-File Object"
@@ -620,11 +626,9 @@
(let ((s "Hello\nÃÃÃ"))
(bytevector=?
(string->utf8 s)
- (call-with-bytevector-output-port
- (lambda (bv-port)
- (call-with-port (transcoded-port bv-port (make-transcoder
(utf-8-codec)))
- (lambda (utf8-port)
- (put-string utf8-port s))))))))
+ (call-with-bytevector-output-port/transcoded (make-transcoder
(utf-8-codec))
+ (lambda (utf8-port)
+ (put-string utf8-port s))))))
(pass-if "transcoded-port [input]"
(let ((s "Hello\nÃÃÃ"))
@@ -720,6 +724,11 @@
(pass-if-condition "get-datum" i/o-read-error?
(get-datum (make-failing-port)))))
+(define (encoding-error-predicate char)
+ (lambda (c)
+ (and (i/o-encoding-error? c)
+ (char=? char (i/o-encoding-error-char c)))))
+
(with-test-prefix "8.2.12 Textual Output"
(with-test-prefix "write error"
@@ -728,7 +737,22 @@
(pass-if-condition "put-string" i/o-write-error?
(put-string (make-failing-port) "Hello World!"))
(pass-if-condition "put-datum" i/o-write-error?
- (put-datum (make-failing-port) '(hello world!)))))
+ (put-datum (make-failing-port) '(hello world!))))
+ (with-test-prefix "encoding error"
+ (pass-if-condition "put-char" (encoding-error-predicate #\λ)
+ (call-with-bytevector-output-port/transcoded
+ (make-transcoder (latin-1-codec)
+ (native-eol-style)
+ (error-handling-mode raise))
+ (lambda (port)
+ (put-char port #\λ))))
+ (pass-if-condition "put-string" (encoding-error-predicate #\λ)
+ (call-with-bytevector-output-port/transcoded
+ (make-transcoder (latin-1-codec)
+ (native-eol-style)
+ (error-handling-mode raise))
+ (lambda (port)
+ (put-string port "FooλBar"))))))
(with-test-prefix "8.3 Simple I/O"
(with-test-prefix "read error"
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.1-102-gdfc4d56,
Andreas Rottmann <=