From d3a1a74cb8764cf1f60e3d0eb0b5369cb05cf6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 31 May 2012 14:29:25 +0200 Subject: [PATCH] Fix port test that assumed string ports use the `error' conversion strategy. This is a followup to 9f6e3f5a997f484548bd03e7e7573c38a95c8d09 ("Have string ports honor `%default-port-conversion-strategy'."). * test-suite/tests/r6rs-ports.test ("7.2.11 Binary Output")["put-bytevector with wrong-encoding string port"]: Set %DEFAULT-PORT-CONVERSION-STRATEGY to 'error. Return #f when no exception is raised. ("8.2.6 Input and output ports")["transcoded-port [error handling mode = raise]"]: Return #f when no exception is raised. --- test-suite/tests/r6rs-ports.test | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test-suite/tests/r6rs-ports.test b/test-suite/tests/r6rs-ports.test index f3e8c2c5d..46da67f59 100644 --- a/test-suite/tests/r6rs-ports.test +++ b/test-suite/tests/r6rs-ports.test @@ -1,6 +1,6 @@ ;;;; r6rs-ports.test --- R6RS I/O port tests. -*- coding: utf-8; -*- ;;;; -;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. ;;;; Ludovic Courtès ;;;; ;;;; This library is free software; you can redistribute it and/or @@ -306,10 +306,12 @@ (bv (string->utf16 str))) (catch 'decoding-error (lambda () - (with-fluids ((%default-port-encoding "UTF-32")) + (with-fluids ((%default-port-encoding "UTF-32") + (%default-port-conversion-strategy 'error)) (call-with-output-string (lambda (port) - (put-bytevector port bv))))) + (put-bytevector port bv))) + #f)) ; fail if we reach this point (lambda (key subr message errno port) (string? (strerror errno))))))) @@ -662,7 +664,8 @@ (tp (transcoded-port b t))) (guard (c ((i/o-decoding-error? c) (eq? (i/o-error-port c) tp))) - (get-line tp)))) + (get-line tp) + #f))) ; fail if we reach this point (pass-if "transcoded-port [error handling mode = replace]" (let* ((t (make-transcoder (utf-8-codec) (native-eol-style)