diff options
author | Karl Williamson <khw@cpan.org> | 2019-11-01 13:09:11 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-11-22 06:49:03 -0700 |
commit | 8d83133d4092939786340151d2e2c2790fc72ec9 (patch) | |
tree | 24d7de609b3c2f698e52ded3b0ec707e5fe3e291 /dist/Devel-PPPort/parts/inc | |
parent | 1dc6f3b5030050a81022fa9e6e4a9e200c0f446a (diff) | |
download | perl-8d83133d4092939786340151d2e2c2790fc72ec9.tar.gz |
D:P: Convert to use modern Test functions
This commit copies much of test.pl from blead to replace the Test ones.
These versions are much friendlier to use. Several .t files required
minor changes to work with these. pv_tools.t was the only file using
the old obsolete skip() functionality fully. The new version does not
do a 'last SKIP', for compatibility.
like and unlike were not ported because of the absence of qr// in perls
this is supposed to work on.
And the portions of test.pl that were copied also required a few minor
changes to work back to 5.3.7.
Not all the ported functionality is currently in used. It may be that
changes will have to be made to it to get it to work; or will have to be
deleted.
Diffstat (limited to 'dist/Devel-PPPort/parts/inc')
-rw-r--r-- | dist/Devel-PPPort/parts/inc/call | 6 | ||||
-rw-r--r-- | dist/Devel-PPPort/parts/inc/cop | 9 | ||||
-rw-r--r-- | dist/Devel-PPPort/parts/inc/pv_tools | 16 |
3 files changed, 15 insertions, 16 deletions
diff --git a/dist/Devel-PPPort/parts/inc/call b/dist/Devel-PPPort/parts/inc/call index 683887f322..bdfe812f06 100644 --- a/dist/Devel-PPPort/parts/inc/call +++ b/dist/Devel-PPPort/parts/inc/call @@ -338,12 +338,6 @@ load_module(flags, name, version, ...) =tests plan => 86 -sub eq_array -{ - my($a, $b) = @_; - join(':', @$a) eq join(':', @$b); -} - sub f { shift; diff --git a/dist/Devel-PPPort/parts/inc/cop b/dist/Devel-PPPort/parts/inc/cop index 8af91b2672..061166ab02 100644 --- a/dist/Devel-PPPort/parts/inc/cop +++ b/dist/Devel-PPPort/parts/inc/cop @@ -167,7 +167,7 @@ caller_cx(level) #endif /* 5.6.0 */ -=tests plan => 28 +=tests plan => 8 my $package; { @@ -184,7 +184,7 @@ ok($file =~ /cop/i); BEGIN { if ("$]" < 5.006000) { # Skip - for (1..28) { + for (1..8) { ok(1, 1); } exit; @@ -223,9 +223,6 @@ for ( ) { my ($sub, $arg, @want) = @$_; my @got = $sub->($arg); - ok(@got, @want); - for (0..$#want) { - ok($got[$_], $want[$_]); - } + ok(eq_array(\@got, \@want)); } diff --git a/dist/Devel-PPPort/parts/inc/pv_tools b/dist/Devel-PPPort/parts/inc/pv_tools index c51d91ab22..31b330efef 100644 --- a/dist/Devel-PPPort/parts/inc/pv_tools +++ b/dist/Devel-PPPort/parts/inc/pv_tools @@ -262,11 +262,19 @@ ok($r[0], "foobarbaz"); ok($r[2], $r[3]); ok($r[2], '<leftpv_p\retty\nright>'); ok($r[4], $r[5]); -skip(ord("A") != 65 ? "Skip for non-ASCII platform" : 0, - $r[4], $uni ? 'N\375 Batter\355' : 'N\303\275 Batter\303'); +if(ord("A") == 65) { + is($r[4], $uni ? 'N\375 Batter\355' : 'N\303\275 Batter\303'); +} +else { + skip("Skip for non-ASCII platform"); +} ok($r[6], $r[7]); -skip(ord("A") != 65 ? "Skip for non-ASCII platform" : 0, - $r[6], $uni ? '\301g\346tis Byrju...' : '\303\201g\303\246t...'); +if(ord("A") == 65) { + is($r[6], $uni ? '\301g\346tis Byrju...' : '\303\201g\303\246t...'); +} +else { + skip("Skip for non-ASCII platform"); +} @r = &Devel::PPPort::pv_display(); ok($r[0], $r[1]); |