[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/13: encoding test tries to delete a file that is not
From: |
Mike Gran |
Subject: |
[Guile-commits] 01/13: encoding test tries to delete a file that is not closed |
Date: |
Thu, 21 Jan 2021 19:06:14 -0500 (EST) |
mike121 pushed a commit to branch master
in repository guile.
commit fe505e1a2aa8f71ab68cac878840aff9f3d2ede6
Author: Michael Gran <spk121@yahoo.com>
AuthorDate: Wed Dec 23 09:00:02 2020 -0800
encoding test tries to delete a file that is not closed
On Windows, deleting a file on an open port does not succeed
* test-suite/tests/ports.test ("%default-port-encoding, wrong encoding"):
ensure port is closed before deleting
---
test-suite/tests/ports.test | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test
index 31fb2b0..bd7a927 100644
--- a/test-suite/tests/ports.test
+++ b/test-suite/tests/ports.test
@@ -2,7 +2,7 @@
;;;; Jim Blandy <jimb@red-bean.com> --- May 1999
;;;;
;;;; Copyright (C) 1999, 2001, 2004, 2006, 2007, 2009, 2010,
-;;;; 2011, 2012, 2013, 2014, 2015, 2017, 2019, 2020 Free Software
Foundation, Inc.
+;;;; 2011, 2012, 2013, 2014, 2015, 2017, 2019, 2020, 2021 Free Software
Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -1318,14 +1318,17 @@
(set-port-encoding! p "does-not-exist")
(read p)))
- (let ((filename (test-file)))
- (with-output-to-file filename (lambda () (write 'test)))
+ (let* ((filename (test-file))
+ (port (open-output-file filename)))
+ (write 'test port)
+ (close-port port)
(pass-if-exception "%default-port-encoding, wrong encoding"
exception:miscellaneous-error
- (read (with-fluids ((%default-port-encoding "does-not-exist"))
- (open-input-file filename))))
-
+ (with-fluids ((%default-port-encoding "does-not-exist"))
+ (set! port (open-input-file filename))
+ (read port)))
+ (false-if-exception (close-port port))
(delete-file filename)))
;;;
- [Guile-commits] branch master updated (1a6eaba -> 91d4d31), Mike Gran, 2021/01/21
- [Guile-commits] 02/13: for socket test, don't presume TMP is usable, Mike Gran, 2021/01/21
- [Guile-commits] 01/13: encoding test tries to delete a file that is not closed,
Mike Gran <=
- [Guile-commits] 04/13: in command line encoding test don't presume extant UTF-8 locale, Mike Gran, 2021/01/21
- [Guile-commits] 03/13: skip compile test when pause not available, Mike Gran, 2021/01/21
- [Guile-commits] 06/13: test-foreign-object-c should link libgnu, Mike Gran, 2021/01/21
- [Guile-commits] 05/13: for dynamic-link tests, mingw needs to link to msvcrt, Mike Gran, 2021/01/21
- [Guile-commits] 07/13: missing includes for list.h, Mike Gran, 2021/01/21
- [Guile-commits] 08/13: Need Guile and Windows types for the declarations posix-w32, Mike Gran, 2021/01/21
- [Guile-commits] 09/13: in null threads, don't define sigmask stub when pthread_sigmask does not exist, Mike Gran, 2021/01/21
- [Guile-commits] 11/13: standalone tests require libgnu on DLL-based platforms, Mike Gran, 2021/01/21
- [Guile-commits] 12/13: avoid a ports test when fcntl is not provided, Mike Gran, 2021/01/21
- [Guile-commits] 10/13: skip version test if git-version-gen can't compute version from git, Mike Gran, 2021/01/21