@@ -47,8 +47,8 @@ BEGIN {
47
47
}
48
48
49
49
# test DB::DB()
50
- {
51
- ok( ! defined DB::DB(),
50
+ {
51
+ ok( ! defined DB::DB(),
52
52
' DB::DB() should return undef if $DB::ready is false' );
53
53
is( DB::catch(), 1, ' DB::catch() should work' );
54
54
is( DB-> skippkg(' foo' ), 1, ' DB->skippkg() should push args' );
@@ -133,9 +133,9 @@ is( DB::_clientname('bar'), undef,
133
133
like( $ret [0], qr /\@ = &eval \' one.+?2\)\' / , # '
134
134
' ... should find eval STRING construct' );
135
135
$ret [0] = check_context(1);
136
- like( $ret [0], qr /\$ = &main::check_context/ ,
136
+ like( $ret [0], qr /\$ = &main::check_context/ ,
137
137
' ... should respect context of calling construct' );
138
-
138
+
139
139
$DB::signal = 1;
140
140
@DB::args = (1, 7);
141
141
@ret = three(1);
@@ -181,11 +181,11 @@ sub three { two(@_) }
181
181
%DB::sub = map { $_ => $_ } qw( bazbar bazboo boobar booboo boobaz ) ;
182
182
my @ret = DB-> filesubs();
183
183
is( scalar @ret , 2, ' DB::filesubs() should use $DB::filename with no args' );
184
- @ret = grep { / ^baz/ } @ret ;
184
+ @ret = grep { / ^baz/ } @ret ;
185
185
is( scalar @ret , 2, ' ... should pick up subs in proper file' );
186
186
@ret = DB-> filesubs(' boo' );
187
187
is( scalar @ret , 3, ' ... should use argument to find subs' );
188
- @ret = grep { / ^boo/ } @ret ;
188
+ @ret = grep { / ^boo/ } @ret ;
189
189
is( scalar @ret , 3, ' ... should pick up subs in proper file with argument' );
190
190
}
191
191
@@ -214,7 +214,7 @@ SKIP: {
214
214
my $db = DB-> loadfile($file );
215
215
like( $db , qr !$file \z ! , ' ... should find loaded file from partial name' );
216
216
217
- is( *DB::dbline, *{ " _<$db " } ,
217
+ is( *DB::dbline, *{ " _<$db " } ,
218
218
' ... should set *DB::dbline to associated glob' );
219
219
is( $DB::filename , $db , ' ... should set $DB::filename to file name' );
220
220
@@ -227,7 +227,7 @@ SKIP: {
227
227
228
228
local $DB::filename = ' baz' ;
229
229
local *baz = *{ " main::_<baz" };
230
-
230
+
231
231
@baz = map { dualvar(1, $_ ) } qw( one two three four five ) ;
232
232
%baz = (
233
233
1 => " foo\0 bar" ,
@@ -257,13 +257,13 @@ SKIP: {
257
257
local %DB::sub = (
258
258
' main::foo' => ' foo:1-4' ,
259
259
);
260
-
260
+
261
261
DB-> set_break(1, ' foo' );
262
262
is( $DB::dbline {1 }, " foo\0 " , ' DB::set_break() should set break condition' );
263
263
264
264
$DB::lineno = 1;
265
265
DB-> set_break(undef , ' bar' );
266
- is( $DB::dbline {1 }, " bar\0 " ,
266
+ is( $DB::dbline {1 }, " bar\0 " ,
267
267
' ... should use $DB::lineno without specified line' );
268
268
269
269
DB-> set_break(4);
@@ -273,7 +273,7 @@ SKIP: {
273
273
' main::foo' => ' foo:1-4' ,
274
274
);
275
275
DB-> set_break(' foo' , ' baz' );
276
- is( $DB::dbline {4 }, " baz\0 abc" ,
276
+ is( $DB::dbline {4 }, " baz\0 abc" ,
277
277
' ... should use _find_subline() to resolve subname' );
278
278
279
279
my $db = FakeDB-> new();
@@ -296,7 +296,7 @@ SKIP: {
296
296
' main::foo' => ' foo:1-4' ,
297
297
);
298
298
DB-> set_tbreak(' foo' , ' baz' );
299
- is( $DB::dbline {4 }, ' ;9' ,
299
+ is( $DB::dbline {4 }, ' ;9' ,
300
300
' ... should use _find_subline() to resolve subname' );
301
301
302
302
my $db = FakeDB-> new();
@@ -321,21 +321,21 @@ SKIP: {
321
321
322
322
$foo [11] = $dualtrue ;
323
323
324
- is( DB::_find_subline(' TEST::foo' ), 11,
324
+ is( DB::_find_subline(' TEST::foo' ), 11,
325
325
' DB::_find_subline() should find fully qualified sub' );
326
326
is( DB::_find_subline(" TEST'foo" ), 11, ' ... should handle old package sep' );
327
- is( DB::_find_subline(' foo' ), 11,
327
+ is( DB::_find_subline(' foo' ), 11,
328
328
' ... should resolve unqualified package name to main::' );
329
329
330
330
$DB::package = ' bar' ;
331
- is( DB::_find_subline(' bar' ), 11,
331
+ is( DB::_find_subline(' bar' ), 11,
332
332
' ... should resolve unqualified name with $DB::package, if defined' );
333
-
333
+
334
334
$foo [11] = $dualfalse ;
335
335
336
- is( DB::_find_subline(' TEST::foo' ), 15,
336
+ is( DB::_find_subline(' TEST::foo' ), 15,
337
337
' ... should increment past lines with no events' );
338
-
338
+
339
339
ok( ! defined DB::_find_subline(' sirnotappearinginthisfilm' ),
340
340
' ... should not find nonexistent sub' );
341
341
}
@@ -367,25 +367,25 @@ SKIP: {
367
367
%DB::dbline = %lines ;
368
368
DB-> clr_breaks(' foo' );
369
369
370
- is( $DB::dbline {3 }, " \0\0\0 abc" ,
370
+ is( $DB::dbline {3 }, " \0\0\0 abc" ,
371
371
' ... should find lines via _find_subline()' );
372
-
372
+
373
373
my $db = FakeDB-> new();
374
374
DB::clr_breaks($db , ' abadsubname' );
375
- is( $db -> {output }, " Subroutine not found.\n " ,
375
+ is( $db -> {output }, " Subroutine not found.\n " ,
376
376
' ... should output warning if sub cannot be found' );
377
377
378
378
@DB::dbline = (1 .. 4);
379
379
%DB::dbline = (%lines , 5 => " \0 " );
380
380
381
381
DB::clr_breaks();
382
382
383
- is( scalar keys %DB::dbline , 4,
383
+ is( scalar keys %DB::dbline , 4,
384
384
' Relying on @DB::dbline in DB::clr_breaks() should clear breaks' );
385
385
ok( ! exists ($DB::dbline {1 }), ' ... should delete empty actions' );
386
386
is( $DB::dbline {3 }, " \0\0\0 abc" , ' ... should remove break, leaving action' );
387
387
is( $DB::dbline {4 }, " \0\0\0 abc" , ' ... should not remove set actions' );
388
- ok( exists ($DB::dbline {5 }),
388
+ ok( exists ($DB::dbline {5 }),
389
389
' ... should only go to last index of @DB::dbline' );
390
390
}
391
391
@@ -400,18 +400,18 @@ SKIP: {
400
400
*DB::dbline = [ $dualfalse , $dualfalse , $dualtrue , $dualtrue ];
401
401
402
402
DB-> set_action(2, ' def' );
403
- is( $DB::dbline {2 }, " \0 def" ,
403
+ is( $DB::dbline {2 }, " \0 def" ,
404
404
' DB::set_action() should replace existing action' );
405
405
DB-> set_action(3, ' ' );
406
406
is( $DB::dbline {3 }, " \0 " , ' ... should set new action' );
407
407
408
408
my $db = FakeDB-> new();
409
409
DB::set_action($db , ' abadsubname' );
410
- is( $db -> {output }, " Subroutine not found.\n " ,
410
+ is( $db -> {output }, " Subroutine not found.\n " ,
411
411
' ... should output warning if sub cannot be found' );
412
412
413
413
DB::set_action($db , 1);
414
- like( $db -> {output }, qr / 1 not action/ ,
414
+ like( $db -> {output }, qr / 1 not action/ ,
415
415
' ... should warn if line cannot be actionivated' );
416
416
}
417
417
@@ -446,23 +446,23 @@ SKIP: {
446
446
DB-> clr_actions(' foo' );
447
447
448
448
is( $DB::dbline {3 }, " 123" , ' ... should find lines via _find_subline()' );
449
-
449
+
450
450
my $db = FakeDB-> new();
451
451
DB::clr_actions($db , ' abadsubname' );
452
- is( $db -> {output }, " Subroutine not found.\n " ,
452
+ is( $db -> {output }, " Subroutine not found.\n " ,
453
453
' ... should output warning if sub cannot be found' );
454
454
455
455
@DB::dbline = (1 .. 4);
456
456
%DB::dbline = (%lines , 5 => " \0 " );
457
457
458
458
DB::clr_actions();
459
459
460
- is( scalar keys %DB::dbline , 4,
460
+ is( scalar keys %DB::dbline , 4,
461
461
' Relying on @DB::dbline in DB::clr_actions() should clear actions' );
462
462
ok( ! exists ($DB::dbline {1 }), ' ... should delete empty actions' );
463
463
is( $DB::dbline {3 }, " 123" , ' ... should remove action, leaving break' );
464
464
is( $DB::dbline {4 }, " abc\0 " , ' ... should not remove set breaks' );
465
- ok( exists ($DB::dbline {5 }),
465
+ ok( exists ($DB::dbline {5 }),
466
466
' ... should only go to last index of @DB::dbline' );
467
467
}
468
468
@@ -473,7 +473,7 @@ DB::prestop('test', 897);
473
473
is( DB::prestop(' test' ), 897, ' ... should return value when set' );
474
474
475
475
# test DB::poststop(), not exactly parallel
476
- ok( ! defined DB::poststop(' tset' ),
476
+ ok( ! defined DB::poststop(' tset' ),
477
477
' DB::prestop() should return undef for undef value' );
478
478
DB::poststop(' tset' , 987);
479
479
is( DB::poststop(' tset' ), 987, ' ... should return value when set' );
@@ -490,7 +490,7 @@ ok( DB::register( FakeDB->new() ), 'DB::register() should work' );
490
490
DB::register( FakeDB-> new() ) for ( 1 .. 2);
491
491
492
492
DB::_outputall(1, 2, 3);
493
- is( $FakeDB::output , ' 123123123' ,
493
+ is( $FakeDB::output , ' 123123123' ,
494
494
' DB::_outputall() should call output(@_) on all clients' );
495
495
496
496
# test virtual methods
0 commit comments