Subject: | Blessed GLOBs and the pad |
diff -urN Devel-ebug-0.42.orig/t/glob.pl Devel-ebug-0.42/t/glob.pl
--- Devel-ebug-0.42.orig/t/glob.pl 1970-01-01 12:00:00.000000000 +1200
+++ Devel-ebug-0.42/t/glob.pl 2005-05-06 13:11:31.000000000 +1200
@@ -0,0 +1,9 @@
+
+my $glob = \*foo;
+
+delete $main::{foo};
+
+bless $glob, "this";
+
+print "Glob is: $glob\n";
+
diff -urN Devel-ebug-0.42.orig/t/glob.t Devel-ebug-0.42/t/glob.t
--- Devel-ebug-0.42.orig/t/glob.t 1970-01-01 12:00:00.000000000 +1200
+++ Devel-ebug-0.42/t/glob.t 2005-05-06 13:14:18.000000000 +1200
@@ -0,0 +1,27 @@
+#!perl
+use strict;
+use warnings;
+use lib 'lib';
+
+use Test::More tests => 19;
+use Devel::ebug;
+
+my $ebug = Devel::ebug->new;
+$ebug->program("t/glob.pl");
+$ebug->load;
+
+# Let's step through the program, and check that we step through the
+# lines in the right order
+
+my @lines = (2, 4, 6, 8);
+
+my $it = 0;
+while (!$ebug->finished) {
+ my $l = shift @lines;
+ is($ebug->line, $l, "Line number correct ($l)");
+ is($ebug->package, 'main', "Package correct");
+ is($ebug->filename, 't/glob.pl', "Filename correct");
+ ok($ebug->codeline, "Got a code line");
+ ok($ebug->pad, "can get the pad ok") if $it++;
+ $ebug->next;
+}