From 003803150649975717d6fbaf8b20062ff5d21125 Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Wed, 31 Jul 2019 17:29:47 +0300 Subject: [PATCH] run-program.tests.sh: use latin-1 when decoding environ. Reported by Jeronimo Pellegrini. --- tests/run-program.test.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) mode change 100644 => 100755 tests/run-program.test.sh diff --git a/tests/run-program.test.sh b/tests/run-program.test.sh old mode 100644 new mode 100755 index 03778521b..3a0874170 --- a/tests/run-program.test.sh +++ b/tests/run-program.test.sh @@ -64,20 +64,22 @@ run_sbcl --eval "(defvar *exit-ok* $EXIT_LISP_WIN)" <<'EOF' ;; The default Unix environment for the subprocess is the same as ;; for the parent process. (I.e., we behave like perl and lots of ;; other programs, but not like CMU CL.) - (let ((string (with-output-to-string (stream) + (let* ((sb-impl::*default-external-format* :latin-1) + (sb-alien::*default-c-string-external-format* :latin-1) + (string (with-output-to-string (stream) (sb-ext:run-program "/usr/bin/env" () :output stream))) - (expected (apply #'concatenate + (expected (apply #'concatenate 'string (mapcar (lambda (environ-string) (concatenate 'string environ-string (string #\newline))) (sb-ext:posix-environ))))) - (assert (string= string expected))) - ;; That's not just because POSIX-ENVIRON is having a bad hair - ;; day and returning NIL, is it? - (assert (plusp (length (sb-ext:posix-environ)))) + (assert (string= string expected)) + ;; That's not just because POSIX-ENVIRON is having a bad hair + ;; day and returning NIL, is it? + (assert (plusp (length (sb-ext:posix-environ))))) ;; make sure that a stream input argument is basically reasonable. (let ((string (let ((i (make-string-input-stream "abcdef"))) (with-output-to-string (stream)