]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: tac: test --regex with anchors in the separator
authorCollin Funk <collin.funk1@gmail.com>
Mon, 26 Jan 2026 01:12:18 +0000 (17:12 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Tue, 27 Jan 2026 02:37:37 +0000 (18:37 -0800)
* tests/tac/tac.pl (@Tests): Add a few test cases.

tests/tac/tac.pl

index 576978aea915189d67d5b45fc0a1555c9da50419..99d2d0d504539fb9ff14d7b2e6c6165ab243d732 100755 (executable)
@@ -63,6 +63,10 @@ my @Tests =
    {IN=>"a.___b.__1._2.__3.___4._"},
    {OUT=>"4._3.___2.__1._b.__a.___"}],
 
+ ['opt-r3', qw(-r -s '^'), {IN=>"a\nb\nc\n"}, {OUT=>"c\nb\na\n"}],
+ ['opt-r4', qw(-r -s '$'), {IN=>"a\nb\nc\n"}, {OUT=>"\n\nc\nba"}],
+ ['opt-r5', qw(-r -s '^$'), {IN=>"a\nb\nc\n"}, {OUT=>"a\nb\nc\n"}],
+
   # This gave incorrect output (.___4._2.__3._1) with tac-1.22.
   ['opt-br', qw(-b -r -s '\._+'),
    {IN=>"._1._2.__3.___4"}, {OUT=>".___4.__3._2._1"}],