diff options
author | Jim Meyering <jim@meyering.net> | 1994-11-14 22:31:47 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1994-11-14 22:31:47 +0000 |
commit | 005bf814613c0b49ed82126fa43bccae227e4d51 (patch) | |
tree | 8acf8d514a113e1c3ddb072155fb1bbf2b0a1e4f /tests/join | |
parent | 6b558ed117043015a6f87a1d77d5053bef655711 (diff) | |
download | coreutils-005bf814613c0b49ed82126fa43bccae227e4d51.tar.xz |
.
Diffstat (limited to 'tests/join')
-rwxr-xr-x | tests/join/build-script | 11 | ||||
-rwxr-xr-x | tests/join/test.data.pl | 11 |
2 files changed, 19 insertions, 3 deletions
diff --git a/tests/join/build-script b/tests/join/build-script index 01fbd2e02..1dd2ed32f 100755 --- a/tests/join/build-script +++ b/tests/join/build-script @@ -1,12 +1,12 @@ #!/p/bin/perl5.000 -w $join = 'join'; -$join = '/usr/bin/join'; $join = './join'; +$join = '/usr/bin/join'; $test = 0; $| = 1; -print ":\nerrors=0\n"; +print ":\n$join --version\nerrors=0\n"; $expected = ''; $flags = ''; $f1 = ''; @@ -14,12 +14,17 @@ $f2 = ''; while (<>) { - next if (/^\s*#/); + next if (/^\s*#/ || /^\s+$/); $test++; chop; $prog = '($test_name, $flags,$f1,$f2,$expected,$e_ret_code) = ' . $_ . ';'; eval $prog; + if (defined ($seen{$test_name})) + { + die "$0: $.: duplicate test name \`$test_name'\n"; + } + $seen{$test_name} = 1; $in1 = "t$test_name.1"; $in2 = "t$test_name.2"; $exp_name = 't' . $test_name . '.exp'; diff --git a/tests/join/test.data.pl b/tests/join/test.data.pl index 5078a4f81..1eb69ff46 100755 --- a/tests/join/test.data.pl +++ b/tests/join/test.data.pl @@ -5,9 +5,20 @@ ('1a', '-a1', "a 1\n", "b\n", "a 1\n", 0); ('1b', '-a2', "a 1\n", "b\n", "b\n", 0); # Got "\n" ('1c', '-a1 -a2', "a 1\n", "b\n", "a 1\nb\n", 0); # Got "a 1\n\n" +('1d', '-a1', "a 1\nb\n", "b\n", "a 1\nb\n", 0); +('1e', '-a2', "a 1\nb\n", "b\n", "b\n", 0); +('1f', '-a2', "b\n", "a\nb\n", "a\nb\n", 0); ('2a', '-a1 -e .', "a\nb\nc\n", "a x y\nb\nc\n", "a x y\nb\nc\n", 0); ('2b', '-a1 -e . -o 2.1,2.2,2.3', "a\nb\nc\n", "a x y\nb\nc\n", "a x y\nb . .\nc . .\n", 0); ('2c', '-a1 -e . -o 2.1,2.2,2.3', "a\nb\nc\nd\n", "a x y\nb\nc\n", "a x y\nb . .\nc . .\nd\n", 0); ('3a', '-t:', "a:1\nb:1\n", "a:2:\nb:2:\n", "a:1:2:\nb:1:2:\n", 0); + +# Just like -a1 and -a2 when there are no pairable lines +('4a', '-v 1', "a 1\n", "b\n", "a 1\n", 0); +('4b', '-v 2', "a 1\n", "b\n", "b\n", 0); + +('4c', '-v 1', "a 1\nb\n", "b\n", "a 1\n", 0); +('4d', '-v 2', "a 1\nb\n", "b\n", "", 0); +('4e', '-v 2', "b\n", "a 1\nb\n", "a 1\n", 0); |