Upgrade to Devel::PPPort 3.11_05
[p5sagit/p5-mst-13.2.git] / ext / Devel / PPPort / t / call.t
index f50e784..6a5da70 100644 (file)
@@ -4,6 +4,10 @@
 #
 #            Edit mktests.PL and/or parts/inc/call instead.
 #
+#  This file was automatically generated from the definition files in the
+#  parts/inc/ subdirectory by mktests.PL. To learn more about how all this
+#  works, please read the F<HACKERS> file that came with this distribution.
+#
 ################################################################################
 
 BEGIN {
@@ -12,7 +16,7 @@ BEGIN {
     @INC = ('../lib', '../ext/Devel/PPPort/t') if -d '../lib' && -d '../ext';
     require Config; import Config;
     use vars '%Config';
-    if (" $Config{'extensions'} " !~ m[ Devel/PPPort ] ) {
+    if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
       print "1..0 # Skip -- Perl configured without Devel::PPPort module\n";
       exit 0;
     }
@@ -21,13 +25,14 @@ BEGIN {
     unshift @INC, 't';
   }
 
-  eval "use Test";
-  if ($@) {
-    require 'testutil.pl';
-    print "1..44\n";
+  sub load {
+    eval "use Test";
+    require 'testutil.pl' if $@;
   }
-  else {
-    plan(tests => 44);
+
+  if (46) {
+    load();
+    plan(tests => 46);
   }
 }
 
@@ -35,6 +40,14 @@ use Devel::PPPort;
 use strict;
 $^W = 1;
 
+package Devel::PPPort;
+use vars '@ISA';
+require DynaLoader;
+@ISA = qw(DynaLoader);
+bootstrap Devel::PPPort;
+
+package main;
+
 sub eq_array
 {
   my($a, $b) = @_;
@@ -87,3 +100,7 @@ for $test (
 ok(&Devel::PPPort::eval_pv('f()', 0), 'y');
 ok(&Devel::PPPort::eval_pv('f(qw(a b c))', 0), 'y');
 
+ok(!defined $::{'less::'}, 1, "Hadn't loaded less yet");
+Devel::PPPort::load_module(0, "less", undef);
+ok(defined $::{'less::'}, 1, "Have now loaded less");
+