mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
Fix port test that assumed string ports use the `error' conversion strategy.
This is a followup to 9f6e3f5a99
("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.
This commit is contained in:
parent
9f6e3f5a99
commit
d3a1a74cb8
1 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue