- local *DB::dbline;
- my %lines = (
- 1 => "\0",
- 2 => undef,
- 3 => "123\0abc",
- 4 => "abc\0",
- );
-
- %DB::dbline = %lines;
- *DB::dbline = [ ($dualtrue) x 4 ];
-
- DB->clr_actions(1 .. 4);
-
- is( scalar keys %DB::dbline, 2, 'DB::clr_actions() should clear actions' );
- ok( ! exists($DB::dbline{1}), '... should delete empty actions' );
- is( $DB::dbline{3}, "123", '... should remove action, leaving break');
- is( $DB::dbline{4}, "abc\0", '... should not remove set breaks' );
-
- local *{ "::_<foo" } = [ 0, 0, 0, 1 ];
-
- local $DB::package;
- local %DB::sub = (
- 'main::foo' => 'foo:1-3',
- );
-
- %DB::dbline = %lines;
- DB->clr_actions('foo');
-
- is( $DB::dbline{3}, "123", '... should find lines via _find_subline()' );
-
- my $db = FakeDB->new();
- DB::clr_actions($db, 'abadsubname');
- is( $db->{output}, "Subroutine not found.\n",
- '... should output warning if sub cannot be found');
-
- @DB::dbline = (1 .. 4);
- %DB::dbline = (%lines, 5 => "\0" );
-
- DB::clr_actions();
-
- is( scalar keys %DB::dbline, 4,
- 'Relying on @DB::dbline in DB::clr_actions() should clear actions' );
- ok( ! exists($DB::dbline{1}), '... should delete empty actions' );
- is( $DB::dbline{3}, "123", '... should remove action, leaving break');
- is( $DB::dbline{4}, "abc\0", '... should not remove set breaks' );
- ok( exists($DB::dbline{5}),
- '... should only go to last index of @DB::dbline' );
+ local *DB::dbline;
+ my %lines = (
+ 1 => "\0",
+ 2 => undef,
+ 3 => "123\0abc",
+ 4 => "abc\0",
+ );
+
+ %DB::dbline = %lines;
+ *DB::dbline = [ ($dualtrue) x 4 ];
+
+ DB->clr_actions(1 .. 4);
+
+ is( scalar keys %DB::dbline, 2, 'DB::clr_actions() should clear actions' );
+ ok( ! exists($DB::dbline{1}), '... should delete empty actions' );
+ is( $DB::dbline{3}, "123", '... should remove action, leaving break');
+ is( $DB::dbline{4}, "abc\0", '... should not remove set breaks' );
+
+ local *{ "::_<foo" } = [ 0, 0, 0, 1 ];
+
+ local $DB::package;
+ local %DB::sub = (
+ 'main::foo' => 'foo:1-3',
+ );
+
+ %DB::dbline = %lines;
+ DB->clr_actions('foo');
+
+ is( $DB::dbline{3}, "123", '... should find lines via _find_subline()' );
+
+ my $db = FakeDB->new();
+ DB::clr_actions($db, 'abadsubname');
+ is( $db->{output}, "Subroutine not found.\n",
+ '... should output warning if sub cannot be found');
+
+ @DB::dbline = (1 .. 4);
+ %DB::dbline = (%lines, 5 => "\0" );
+
+ DB::clr_actions();
+
+ is( scalar keys %DB::dbline, 4,
+ 'Relying on @DB::dbline in DB::clr_actions() should clear actions' );
+ ok( ! exists($DB::dbline{1}), '... should delete empty actions' );
+ is( $DB::dbline{3}, "123", '... should remove action, leaving break');
+ is( $DB::dbline{4}, "abc\0", '... should not remove set breaks' );
+ ok( exists($DB::dbline{5}),
+ '... should only go to last index of @DB::dbline' );