Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added tests for codeline

  • Loading branch information...
commit fc0ff087d5953749509823323ac03e9febb29bca 1 parent 8257c9a
@pmurias pmurias authored
Showing with 14 additions and 4 deletions.
  1. +14 −4 t/codelines.t
View
18 t/codelines.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
use lib 'lib';
-use Test::More tests => 11;
+use Test::More tests => 20;
use Devel::ebug;
my $ebug = Devel::ebug->new;
@@ -12,8 +12,7 @@ $ebug->load;
# Let's get some lines of code
-my @codelines = $ebug->codelines();
-is_deeply(\@codelines, [
+my @calc = (
'#!perl',
'',
'my $q = 1;',
@@ -33,7 +32,10 @@ is_deeply(\@codelines, [
'# unbreakable line',
'my $breakable_line = 1;',
'# other unbreakable line',
-]);
+);
+
+my @codelines = $ebug->codelines();
+is_deeply(\@codelines, \@calc);
@codelines = $ebug->codelines(1, 3, 4, 5);
is_deeply(\@codelines, [
@@ -43,6 +45,14 @@ is_deeply(\@codelines, [
'my $e = add($q, $w);',
]);
+# Let's step through the program, and check that codeline is correct
+
+my @lines = (3, 4, 5, 12, 13, 14, 6, 7, 9);
+foreach my $l (@lines) {
+ is($ebug->codeline, $calc[$l-1]);
+ $ebug->step;
+}
+
$ebug = Devel::ebug->new;
$ebug->program("t/calc_oo.pl");
$ebug->backend("$^X bin/ebug_backend_perl");
Please sign in to comment.
Something went wrong with that request. Please try again.