3 # Copyright (C) 1997, 1998 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 # test name, options, input, expected output, expected return code
27 ['basic-0', '', "", "", 0],
28 ['basic-a', '', "a", "a\n", 0],
29 ['basic-b', '', "\n", "\n", 0],
30 ['basic-c', '', "a\n", "a\n", 0],
31 ['basic-d', '', "a\nb", "b\na\n", 0],
32 ['basic-e', '', "a\nb\n", "b\na\n", 0],
33 ['basic-f', '', "1234567\n8\n", "8\n1234567\n", 0],
34 ['basic-g', '', "12345678\n9\n", "9\n12345678\n", 0],
35 ['basic-h', '', "123456\n8\n", "8\n123456\n", 0],
36 ['basic-i', '', "12345\n8\n", "8\n12345\n", 0],
37 ['basic-j', '', "1234\n8\n", "8\n1234\n", 0],
38 ['basic-k', '', "123\n8\n", "8\n123\n", 0],
40 ['b2-e', '', "a\nb", "b\na\n", 0],
41 ['b2-f', '', "1234567\n8", "8\n1234567\n", 0],
42 ['b2-g', '', "12345678\n9", "9\n12345678\n", 0],
43 ['b2-h', '', "123456\n8", "8\n123456\n", 0],
44 ['b2-i', '', "12345\n8", "8\n12345\n", 0],
45 ['b2-j', '', "1234\n8", "8\n1234\n", 0],
46 ['b2-k', '', "123\n8", "8\n123\n", 0],
48 ['opt-b', '-b', "\na\nb\nc", "\nc\nb\na", 0],
49 ['opt-s', '-s:', "a:b:c:", "c:b:a:", 0],
50 ['opt-sb', '-s : -b', ":a:b:c", ":c:b:a", 0],
51 ['opt-r', "-r -s '\\._+'", "1._2.__3.___4._", "4._3.___2.__1._", 0],
53 ['opt-r2', "-r -s '\\._+'", "a.___b.__1._2.__3.___4._",
54 "4._3.___2.__1._b.__a.___", 0],
56 # This gave incorrect output (.___4._2.__3._1) with tac-1.22.
57 ['opt-br', "-b -r -s '\\._+'", "._1._2.__3.___4", ".___4.__3._2._1", 0],
59 ['opt-br2', "-b -r -s '\\._+'", ".__x.___y.____z._1._2.__3.___4",
60 ".___4.__3._2._1.____z.___y.__x", 0],
68 my ($test_name, $flags, $in, $exp, $ret) = @$t;
70 $Test::input_via{$test_name} = {REDIR => 0, FILE => 0, PIPE => 0}
73 # Temporarily turn off losing tests.
74 # These tests lose because tac_file isn't yet up to snuff with tac_mem.
75 foreach $t (qw (basic-a basic-d b2-e b2-f b2-g b2-h b2-i b2-j b2-k))
77 # $Test::input_via{$t} = {REDIR => 0, PIPE => 0};
78 $Test::input_via{$t} = {};