sh/tests: Add a test for long line in history
This commit is contained in:
@@ -94,6 +94,7 @@ ${PACKAGE}FILES+= export1.0
|
||||
${PACKAGE}FILES+= fc1.0
|
||||
${PACKAGE}FILES+= fc2.0
|
||||
${PACKAGE}FILES+= fc3.0 fc3.0.stdout fc3.0.stderr
|
||||
${PACKAGE}FILES+= fc4.0
|
||||
${PACKAGE}FILES+= for1.0
|
||||
${PACKAGE}FILES+= for2.0
|
||||
${PACKAGE}FILES+= for3.0
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
v=1234
|
||||
v=$v$v$v$v
|
||||
v=$v$v$v$v
|
||||
v=$v$v$v$v
|
||||
#v=$v$v$v$v
|
||||
v=beginlong$v$v$v${v}endlong
|
||||
result=$(ENV= HISTFILE=/dev/null script -q /dev/null ${SH} +m -i -o emacs <<EOF
|
||||
printf '%s\n' "$v"
|
||||
printf 'running %s\n' fc; fc -l
|
||||
EOF
|
||||
)
|
||||
case $result in
|
||||
*'running fc'*beginlong*endlong*) ;;
|
||||
*)
|
||||
set -x
|
||||
: result is "$result"
|
||||
exit 2
|
||||
esac
|
||||
result=${result#*running fc}
|
||||
result=${result#*beginlong}
|
||||
result=${result%endlong*}
|
||||
reflected=beginlong${result}endlong
|
||||
if [ "$v" != "$reflected" ]; then
|
||||
set -x
|
||||
: expected "$v" reflected "$reflected"
|
||||
exit 3
|
||||
fi
|
||||
Reference in New Issue
Block a user