From 2a2d6a0ee601cc3f550c424bd4584580f5641c5e Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 24 Jan 2011 16:24:28 +0000 Subject: Exchange dist/Env/t/{array,env}.t, which were transposed by b695f709e8a342e3 --- dist/Env/t/array.t | 70 ++++++++++++++++++++++++++++++++++++++++++++++-------- dist/Env/t/env.t | 70 ++++++++---------------------------------------------- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/dist/Env/t/array.t b/dist/Env/t/array.t index d6a15a6c26..9e87f4a6b2 100644 --- a/dist/Env/t/array.t +++ b/dist/Env/t/array.t @@ -1,16 +1,66 @@ #!./perl -BEGIN { - $ENV{FOO} = "foo"; - $ENV{BAR} = "bar"; -} +$| = 1; use strict; -use Test::More tests => 2; -use Env qw(FOO $BAR); +use Test::More; + +plan(skip_all => "skipped for VMS") if $^O eq 'VMS'; +plan(tests => 11); + +use Env qw(@FOO); +use vars qw(@BAR); + +sub array_equal +{ + my ($a, $b) = @_; + return 0 unless scalar(@$a) == scalar(@$b); + for my $i (0..scalar(@$a) - 1) { + return 0 unless $a->[$i] eq $b->[$i]; + } + return 1; +} + +@FOO = qw(a B c); +@BAR = qw(a B c); +is_deeply(\@FOO, \@BAR, "Assignment"); + +$FOO[1] = 'b'; +$BAR[1] = 'b'; +is_deeply(\@FOO, \@BAR, "Storing"); + +$#FOO = 0; +$#BAR = 0; +is_deeply(\@FOO, \@BAR, "Truncation"); + +push @FOO, 'b', 'c'; +push @BAR, 'b', 'c'; +is_deeply(\@FOO, \@BAR, "Push"); + +pop @FOO; +pop @BAR; +is_deeply(\@FOO, \@BAR, "Pop"); + +shift @FOO; +shift @BAR; +is_deeply(\@FOO, \@BAR, "Shift"); + +push @FOO, 'c'; +push @BAR, 'c'; +is_deeply(\@FOO, \@BAR, "Push"); + +unshift @FOO, 'a'; +unshift @BAR, 'a'; +is_deeply(\@FOO, \@BAR, "Unshift"); + +@FOO = reverse @FOO; +@BAR = reverse @BAR; +is_deeply(\@FOO, \@BAR, "Reverse"); -$FOO .= "/bar"; -$BAR .= "/baz"; +@FOO = sort @FOO; +@BAR = sort @BAR; +is_deeply(\@FOO, \@BAR, "Sort"); -is($FOO, 'foo/bar'); -is($BAR, 'bar/baz'); +splice @FOO, 1, 1, 'B'; +splice @BAR, 1, 1, 'B'; +is_deeply(\@FOO, \@BAR, "Splice"); diff --git a/dist/Env/t/env.t b/dist/Env/t/env.t index 9e87f4a6b2..d6a15a6c26 100644 --- a/dist/Env/t/env.t +++ b/dist/Env/t/env.t @@ -1,66 +1,16 @@ #!./perl -$| = 1; - -use strict; -use Test::More; - -plan(skip_all => "skipped for VMS") if $^O eq 'VMS'; -plan(tests => 11); - -use Env qw(@FOO); -use vars qw(@BAR); - -sub array_equal -{ - my ($a, $b) = @_; - return 0 unless scalar(@$a) == scalar(@$b); - for my $i (0..scalar(@$a) - 1) { - return 0 unless $a->[$i] eq $b->[$i]; - } - return 1; +BEGIN { + $ENV{FOO} = "foo"; + $ENV{BAR} = "bar"; } -@FOO = qw(a B c); -@BAR = qw(a B c); -is_deeply(\@FOO, \@BAR, "Assignment"); - -$FOO[1] = 'b'; -$BAR[1] = 'b'; -is_deeply(\@FOO, \@BAR, "Storing"); - -$#FOO = 0; -$#BAR = 0; -is_deeply(\@FOO, \@BAR, "Truncation"); - -push @FOO, 'b', 'c'; -push @BAR, 'b', 'c'; -is_deeply(\@FOO, \@BAR, "Push"); - -pop @FOO; -pop @BAR; -is_deeply(\@FOO, \@BAR, "Pop"); - -shift @FOO; -shift @BAR; -is_deeply(\@FOO, \@BAR, "Shift"); - -push @FOO, 'c'; -push @BAR, 'c'; -is_deeply(\@FOO, \@BAR, "Push"); - -unshift @FOO, 'a'; -unshift @BAR, 'a'; -is_deeply(\@FOO, \@BAR, "Unshift"); - -@FOO = reverse @FOO; -@BAR = reverse @BAR; -is_deeply(\@FOO, \@BAR, "Reverse"); +use strict; +use Test::More tests => 2; +use Env qw(FOO $BAR); -@FOO = sort @FOO; -@BAR = sort @BAR; -is_deeply(\@FOO, \@BAR, "Sort"); +$FOO .= "/bar"; +$BAR .= "/baz"; -splice @FOO, 1, 1, 'B'; -splice @BAR, 1, 1, 'B'; -is_deeply(\@FOO, \@BAR, "Splice"); +is($FOO, 'foo/bar'); +is($BAR, 'bar/baz'); -- cgit v1.2.1