From b2ef44a277de5bfe85b193ae37c859ea61818ac6 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Mon, 4 Dec 2023 19:30:31 +0100 Subject: [PATCH] Switch test to using our printf This test wants to generate a U+FDD2 to see it is not mishandled. To do so, we tried to use sh, which on my system is bash and can do `$'\ufdd2'`. Unfortunately on other systems it might be dash, which won't do that. Since I don't know of a good no-dependency portable way to generate this (I dimly remember python3 being a shim on some systems, so I do not want to invoke it here), we'll just use our own printf. Which is a worse test, we control both parts, but it'll do. Fixes #10134 --- tests/checks/basic.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checks/basic.fish b/tests/checks/basic.fish index 4971ef66a..a9eee32b1 100644 --- a/tests/checks/basic.fish +++ b/tests/checks/basic.fish @@ -592,8 +592,8 @@ $fish -c 'echo \ufdd2"fart"' # CHECKERR: echo \ufdd2"fart" # CHECKERR: ^~~~~~~~~~~^ -echo (sh -c 'printf \$\'\ufdd2foo\'') | string escape -# CHECK: \$\\ufdd2foo +echo (printf '\ufdd2foo') | string escape +# CHECK: \Xef\Xb7\X92foo printf '%s\n' "#!/bin/sh" 'echo $0' > $tmpdir/argv0.sh chmod +x $tmpdir/argv0.sh