summaryrefslogtreecommitdiff
path: root/tests/tac/Test.pm
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-02-17 01:30:05 +0000
committerJim Meyering <jim@meyering.net>1997-02-17 01:30:05 +0000
commit0d457a806390379c51b2496ff596ab23a01aac8c (patch)
tree705268981eb5a0718adb3aad03b6fdc8fafa5b05 /tests/tac/Test.pm
parent5db942f46c5fcc52c698c56376833b3a0927f53d (diff)
downloadcoreutils-0d457a806390379c51b2496ff596ab23a01aac8c.tar.xz
.
Diffstat (limited to 'tests/tac/Test.pm')
-rw-r--r--tests/tac/Test.pm37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/tac/Test.pm b/tests/tac/Test.pm
new file mode 100644
index 000000000..cf90d7bab
--- /dev/null
+++ b/tests/tac/Test.pm
@@ -0,0 +1,37 @@
+package Test;
+require 5.002;
+use strict;
+
+my @tv = (
+# test name, options, input, expected output, expected return code
+#
+['basic-0', '', "", "", 0],
+['basic-a', '', "a", "a\n", 0],
+['basic-b', '', "\n", "\n", 0],
+['basic-c', '', "a\n", "a\n", 0],
+['basic-d', '', "a\nb", "b\na\n", 0],
+['basic-e', '', "a\nb\n", "b\na\n", 0],
+);
+
+sub test_vector
+{
+ my $t;
+ foreach $t (@tv)
+ {
+ my ($test_name, $flags, $in, $exp, $ret) = @$t;
+
+ # If you run the minus* tests with a FILE arg they'd hang.
+ if ($test_name =~ /^minus/)
+ {
+ $Test::input_via{$test_name} = {REDIR => 0, PIPE => 0};
+ }
+ else
+ {
+ $Test::input_via{$test_name} = {REDIR => 0, FILE => 0, PIPE => 0}
+ }
+ }
+
+ return @tv;
+}
+
+1;