Skip to content

Commit

Permalink
Switch test to using our printf
Browse files Browse the repository at this point in the history
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
  • Loading branch information
faho committed Dec 4, 2023
1 parent 4a618f1 commit b2ef44a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/checks/basic.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2ef44a

Please sign in to comment.