diffutils/tests/expand-tabs
Paul Eggert 6e091776f8 diff: don’t backspace before first column
* src/util.c (output_1_line): When expanding tabs, treat backspace
before column 1 as no-op, since that’s what most devices do.
* tests/expand-tabs: New test.
* tests/Makefile.am (TESTS): Add it.
2023-07-05 11:01:34 -07:00

20 lines
304 B
Bash
Executable File

#!/bin/sh
# Test tab expansion.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
fail=0
cat >exp <<'EOF' || framework_failure_
0a1
> x
EOF
for p in '\b\tx\n' '\b x\n' '\b \tx\n'; do
printf "$p" | returns_ 1 diff -t /dev/null - >out || fail=1
done
compare exp out || fail=1
Exit $fail