Add checks for incomplete escape sequences

Also codify in tests the current, case-sensitive behavior of \C vs \c
This commit is contained in:
Mahmoud Al-Qudsi 2022-09-16 15:43:27 -05:00
parent 351500e42d
commit d2f6c925e1

View file

@ -569,6 +569,24 @@ $fish -c 'echo \utest'
# CHECKERR: echo \utest
# CHECKERR: ^~~~~^
$fish -c 'echo \c'
# CHECKERR: fish: Incomplete escape sequence '\c'
# CHECKERR: echo \c
# CHECKERR: ^^
$fish -c 'echo \C'
# CHECK: C
$fish -c 'echo \U'
# CHECKERR: fish: Incomplete escape sequence '\U'
# CHECKERR: echo \U
# CHECKERR: ^^
$fish -c 'echo \x'
# CHECKERR: fish: Incomplete escape sequence '\x'
# CHECKERR: echo \x
# CHECKERR: ^^
printf '%s\n' "#!/bin/sh" 'echo $0' > $tmpdir/argv0.sh
chmod +x $tmpdir/argv0.sh
cd $tmpdir