diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-06-21 13:59:57 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-06-21 19:01:00 -0700 |
commit | b0dc886d9c1fb5df275b5ea9a95c061a5931e50b (patch) | |
tree | c07877e8e1d0927ec8476e027701a3457568f6cc /tests | |
parent | c57fba2604b4e1095e869de6c844d8c3d973814f (diff) | |
download | grep-b0dc886d9c1fb5df275b5ea9a95c061a5931e50b.tar.gz |
grep: -m no longer cuts off trailing context
Problem reported by Markus Jochim (Bug#26254).
* NEWS, doc/grep.texi (General Output Control): Document this.
* src/grep.c (prpending): Selected lines no longer cut off context.
(usage): Say "selected" instead of "matching", where appropriate.
* tests/foad1, tests/max-count-vs-context, tests/yesno:
Adjust to match new behavior.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/foad1 | 8 | ||||
-rwxr-xr-x | tests/max-count-vs-context | 2 | ||||
-rwxr-xr-x | tests/yesno | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/foad1 b/tests/foad1 index 0163f1a1..e3999819 100755 --- a/tests/foad1 +++ b/tests/foad1 @@ -93,12 +93,12 @@ grep_test "wordword/" "${CB}word${CE}word/" "\<word" --color=always grep_test "4/40/" "4/40/" "^4$" -m1 -A99 grep_test "4/04/" "4/04/" "^4$" -m1 -A99 grep_test "4/444/" "4/444/" "^4$" -m1 -A99 -grep_test "4/40/" "4/" "^4" -m1 -A99 +grep_test "4/40/" "4/40/" "^4" -m1 -A99 grep_test "4/04/" "4/04/" "^4" -m1 -A99 -grep_test "4/444/" "4/" "^4" -m1 -A99 +grep_test "4/444/" "4/444/" "^4" -m1 -A99 grep_test "4/40/" "4/40/" "4$" -m1 -A99 -grep_test "4/04/" "4/" "4$" -m1 -A99 -grep_test "4/444/" "4/" "4$" -m1 -A99 +grep_test "4/04/" "4/04/" "4$" -m1 -A99 +grep_test "4/444/" "4/444/" "4$" -m1 -A99 # Test for "-F -w" bugs. Thanks to Gordon Lack for these two. diff --git a/tests/max-count-vs-context b/tests/max-count-vs-context index 5633dd6a..e80c3ced 100755 --- a/tests/max-count-vs-context +++ b/tests/max-count-vs-context @@ -12,7 +12,7 @@ another needle 6th line... EOF -sed 4q in > exp || framework_failure_ +sed 6q in > exp || framework_failure_ fail=0 grep -m1 -A5 needle in > out 2>err || fail=1 diff --git a/tests/yesno b/tests/yesno index e379c19b..1ae2142f 100755 --- a/tests/yesno +++ b/tests/yesno @@ -73,14 +73,14 @@ set x \ '-C,1,--no-gr' "$rB$C$D$E$rF$rG$H$I$rJ$rL$M$N$z0" \ '-m,4' "$C$D$E$H$z0$XI$XJ$XK$XL$XM$XN" \ '-m,4,-o' "$c$d$e$h$z0$XI$XJ$XK$XL$XM$XN" \ - '-m,4,-C,1' "$rB$C$D$E$rF$rG$H$z0$XI$XJ$XK$XL$XM$XN" \ + '-m,4,-C,1' "$rB$C$D$E$rF$rG$H$rI$z0$XI$XJ$XK$XL$XM$XN" \ '-m,4,-C,1,-o' "$c$d$e$h$z0$XI$XJ$XK$XL$XM$XN" \ '-m,5' "$C$D$E$H$I$z0$XJ$XK$XL$XM$XN" \ '-m,5,-o' "$c$d$e$h$i$z0$XJ$XK$XL$XM$XN" \ '-m,5,-C,1,-o' "$c$d$e$h$i$z0$XJ$XK$XL$XM$XN" \ '-m,6' "$C$D$E$H$I$M$z0$XN" \ '-m,6,-o' "$c$d$e$h$i$m$z0$XN" \ - '-m,6,-C,1' "$rB$C$D$E$rF$rG$H$I$rJ$s$rL$M$z0$XN" \ + '-m,6,-C,1' "$rB$C$D$E$rF$rG$H$I$rJ$s$rL$M$rN$z0$XN" \ '-m,6,-C,1,-o' "$c$d$e$h$i$s$m$z0$XN" \ '-v' "$A$B$F$G$J$K$L$z0" \ '-v,-o' "$z0" \ @@ -92,13 +92,13 @@ set x \ '-4,-v,-1' "$A$B$rC$s$rE$F$G$rH$rI$J$K$L$rM$z0" \ '-m,1,-v' "$A$z0$XB$XC$XD$XE$XF$XG$X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