From 6d2205e8131e9524ea3c3bb8cfd410a412c9fcaf Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 26 May 2019 08:15:44 -0500 Subject: Teach sed about +N range ending. --- tests/sed.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/sed.test b/tests/sed.test index e5ec11bd..98c109ad 100755 --- a/tests/sed.test +++ b/tests/sed.test @@ -151,6 +151,12 @@ testing "trailing a\ (for debian)" "sed 'a\\'" "hello\n" "" "hello" # You have to match the first line of a range in order to activate # the range, numeric and ascii work the same way testing "skip start of range" "sed -e n -e '1,2s/b/c/'" "a\nb\n" "" "a\nb\n" +testing "range +1" "sed -ne '/blah/,+1p'" "blah\n6\n" "" \ + "1\n2\n3\n4\n5\nblah\n6\n7\n8\n9\n" +testing "range +0" "sed -ne '/blah/,+0p'" "blah\n" "" \ + "1\n2\n3\n4\n5\nblah\n6\n7\n8\n9\n" +testing "range +3" "sed -ne '2,+3p'" "2\n3\n4\n5\n" "" \ + "1\n2\n3\n4\n5\nblah\n6\n7\n8\n9\n" #echo meep | sed/sed -e '1a\' -e 'huh' #echo blah | sed/sed -f <(echo -e "1a\\\\\nboom") -- cgit v1.2.3