From 1b47ed271434cea6ebdb28f799b49b6c0b40dc99 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 22 Dec 1996 14:09:10 +0000 Subject: [PATCH] Use test_vector, not array @t. --- tests/cut/Test.pm | 30 +++++++++++++++++------------- tests/join/Test.pm | 10 +++++++--- tests/sort/Test.pm | 7 ++++++- tests/tr/Test.pm | 7 ++++++- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/tests/cut/Test.pm b/tests/cut/Test.pm index 7e0a07271..bfbd6da48 100755 --- a/tests/cut/Test.pm +++ b/tests/cut/Test.pm @@ -2,27 +2,26 @@ package Test; require 5.002; use strict; -my $nl = "\n"; -@Test::t = ( +my @tv = ( # test flags input expected output expected return code # -['1', '-d: -f1,3-', "a:b:c$nl", "a:c\n", 0], +['1', '-d: -f1,3-', "a:b:c\n", "a:c\n", 0], ['2', '-d: -f1,3-', "a:b:c\n", "a:c\n", 0], -['3', '-d: -f2-', "a:b:c$nl", "b:c\n", 0], -['4', '-d: -f4', "a:b:c$nl", "\n", 0], +['3', '-d: -f2-', "a:b:c\n", "b:c\n", 0], +['4', '-d: -f4', "a:b:c\n", "\n", 0], ['5', '-d: -f4', "", "", 0], -['6', '-c4', "123$nl", "\n", 0], +['6', '-c4', "123\n", "\n", 0], ['7', '-c4', "123", "\n", 0], ['8', '-c4', "123\n1", "\n\n", 0], ['9', '-c4', "", "", 0], -['a', '-s -d: -f3-', "a:b:c$nl", "c\n", 0], -['b', '-s -d: -f2,3', "a:b:c$nl", "b:c\n", 0], -['c', '-s -d: -f1,3', "a:b:c$nl", "a:c\n", 0], +['a', '-s -d: -f3-', "a:b:c\n", "c\n", 0], +['b', '-s -d: -f2,3', "a:b:c\n", "b:c\n", 0], +['c', '-s -d: -f1,3', "a:b:c\n", "a:c\n", 0], # Trailing colon should not be output -['d', '-s -d: -f1,3', "a:b:c:$nl", "a:c\n", 0], -['e', '-s -d: -f3-', "a:b:c:$nl", "c:\n", 0], -['f', '-s -d: -f3-4', "a:b:c:$nl", "c:\n", 0], -['g', '-s -d: -f3,4', "a:b:c:$nl", "c:\n", 0], +['d', '-s -d: -f1,3', "a:b:c:\n", "a:c\n", 0], +['e', '-s -d: -f3-', "a:b:c:\n", "c:\n", 0], +['f', '-s -d: -f3-4', "a:b:c:\n", "c:\n", 0], +['g', '-s -d: -f3,4', "a:b:c:\n", "c:\n", 0], # Make sure -s suppresses non-delimited lines ['h', '-s -d: -f2,3', "abc\n", "", 0], # @@ -59,4 +58,9 @@ my $nl = "\n"; ['D', '-b', ":\n", "", 1], ); +sub test_vector +{ + return @tv; +} + 1; diff --git a/tests/join/Test.pm b/tests/join/Test.pm index 80bde167c..381c40ccd 100644 --- a/tests/join/Test.pm +++ b/tests/join/Test.pm @@ -2,7 +2,7 @@ package Test; require 5.002; use strict; -@Test::t = ( +my @tv = ( # test name # flags file-1 file-2 expected output expected return code # @@ -90,8 +90,12 @@ use strict; "a .\nb .\nc .\nd G\ne .\n", 0], # From David Dyck -['9a', '', - [" a 1\n b 2\n", " a Y\n b Z\n"], "a 1 Y\nb 2 Z\n", 0], +['9a', '', [" a 1\n b 2\n", " a Y\n b Z\n"], "a 1 Y\nb 2 Z\n", 0], ); +sub test_vector +{ + return @tv; +} + 1; diff --git a/tests/sort/Test.pm b/tests/sort/Test.pm index cccbe209d..bf2729f03 100755 --- a/tests/sort/Test.pm +++ b/tests/sort/Test.pm @@ -3,7 +3,7 @@ package Test; require 5.002; use strict; -@Test::t = ( +my @tv = ( #test options input expected-output expected-return-code # ["01a", '', "A\nB\nC\n", "A\nB\nC\n", 0], @@ -151,4 +151,9 @@ use strict; ); +sub test_vector +{ + return @tv; +} + 1; diff --git a/tests/tr/Test.pm b/tests/tr/Test.pm index e49898970..b42c7088f 100755 --- a/tests/tr/Test.pm +++ b/tests/tr/Test.pm @@ -4,7 +4,7 @@ use strict; $Test::input_via_stdin = 1; -@Test::t = ( +my @tv = ( # test flags 1 or 2 strings input expected output expected return code # ['1', q|'abcd' '[]*]'|, 'abcd', ']]]]', 0], @@ -97,4 +97,9 @@ $Test::input_via_stdin = 1; ['R6', '-dc ' . q|'[:upper:]'|, '', '', 0], ); +sub test_vector +{ + return @tv; +} + 1;