6 # test name, options, input, expected output, expected return code
8 ['idem-0', '', "", "", 0],
9 ['idem-1', '', "a", "a", 0],
10 ['idem-2', '', "\n", "\n", 0],
11 ['idem-3', '', "a\n", "a\n", 0],
14 "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n",
15 "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n", 0],
18 "1\n2\n3\n4\n5\n6\n7\n8\n9\n",
19 "1\n2\n3\n4\n5\n6\n7\n8\n9\n", 0],
22 "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\nb\n",
23 "1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n", 0],
25 ['obs-0', '-1', "1\n2\n", "1\n", 0],
26 ['obs-1', '-1c', "", "", 0],
27 ['obs-2', '-1c', "12", "1", 0],
28 ['obs-3', '-14c', "1234567890abcdefg", "1234567890abcd", 0],
29 ['obs-4', '-2b', [\'in'], [\'in-1024'], 0],
30 ['obs-5', '-1k', [\'in'], [\'in-1024'], 0],
32 # This test fails for textutils-1.22, because head let 4096m overflow to 0
33 # and did not fail. Now head fails with a diagnostic.
35 # Disable this test because it fails on systems with 64-bit longs.
36 # ['fail-0', '-n 4096m', "a\n", "", 1],
38 # In spite of its name, this test passes -- just to contrast with the above.
39 ['fail-1', '-n 2048m', "a\n", "a\n", 0],
41 # Make sure we don't break like AIX 4.3.1 on files with \0 in them.
42 ['null-1', '', "a\0a\n", "a\0a\n", 0],
44 # Make sure counts are interpreted as decimal.
45 # Before 2.0f, these would have been interpreted as octal
46 ['no-oct-1', '-08', "\n"x12, "\n"x8, 0],
47 ['no-oct-2', '-010', "\n"x12, "\n"x10, 0],
48 ['no-oct-3', '-n 08', "\n"x12, "\n"x8, 0],
49 ['no-oct-4', '-c 08', "\n"x12, "\n"x8, 0],
58 my ($test_name, $flags, $in, $exp, $ret) = @$t;
60 # Derive equivalent, posix-style tests from the obsolescent ones.
61 next if $test_name !~ /^obs-/;
63 $test_name =~ s/^obs-/posix-/;
64 if ($flags =~ /-(\d+)$/)
68 elsif ($flags =~ /-(\d+)([cbk])$/)
71 $suffix = '' if $suffix eq 'c';
72 $flags = "-c $1$suffix";
78 push (@derived_tests, [$test_name, $flags, $in, $exp, $ret]);
81 foreach my $t (@tv, @derived_tests)
83 my ($test_name) = @$t;
84 $Test::input_via{$test_name} = {REDIR => 0, FILE => 0, PIPE => 0}
87 return (@tv, @derived_tests);