diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-11-19 02:49:15 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-11-19 02:50:59 -0800 |
commit | a99b612d1a2ce392a7ca6c59724013a965e81e04 (patch) | |
tree | f54bea2b3fde9af935797c86d78642d1f29bddbb /tests | |
parent | 16c0d20ba4923c496ef4e499319b6d18ca81711a (diff) | |
download | grep-a99b612d1a2ce392a7ca6c59724013a965e81e04.tar.gz |
grep: -T no longer outputs BS
* NEWS: Document this (Bug#24451).
* src/grep.c (print_line_head): Do not attempt to backspace output.
* tests/initial-tab: New test.
* tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rwxr-xr-x | tests/initial-tab | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index b6f0df32..56e860f0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -108,6 +108,7 @@ TESTS = \ in-eq-out-infloop \ include-exclude \ inconsistent-range \ + initial-tab \ invalid-multibyte-infloop \ khadafy \ kwset-abuse \ diff --git a/tests/initial-tab b/tests/initial-tab new file mode 100755 index 00000000..af5efb37 --- /dev/null +++ b/tests/initial-tab @@ -0,0 +1,32 @@ +#!/bin/sh +# Exercise -T. + +# Copyright 2016 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/init.sh"; path_prepend_ ../src + +fail=0 + +printf 'x\n\n' > in || framework_failure_ + +grep -T '^' in > out || fail=1 +compare in out || fail=1 + +printf 'in:\tx\nin:\n' > exp || framework_failure_ +grep -T '^' in /dev/null > out || fail=1 +compare exp out || fail=1 + +Exit $fail |