Changeset 9693


Ignore:
Timestamp:
12/14/09 03:41:38 (2 years ago)
Author:
szabgab
Message:

[Debug::Client] adding more tests

Location:
trunk/Debug-Client
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Debug-Client/Changes

    r9687 r9693  
     1v0.07 
     2    Added more test. 
     3 
    14v0.06 2009.12.14 
    25    Prompt is now the first return paramter 
  • trunk/Debug-Client/t/02-sub-step_out.t

    r9680 r9693  
    1212my $PROMPT = re('\d+'); 
    1313 
    14 plan(tests => 11); 
     14plan(tests => 16); 
    1515 
    1616my $debugger = start_debugger(); 
     
    4747{ 
    4848    my @out = $debugger->step_in; 
    49     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 13, '   my ($q, $w) = @_;'], 'line 13'); 
     49    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 16, '   my ($q, $w) = @_;'], 'line 16'); 
    5050} 
    5151 
    5252{ 
    5353    my @out = $debugger->step_in; 
    54     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 14, '   my $multi = $q * $w;'], 'line 14') 
     54    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 17, '   my $multi = $q * $w;'], 'line 17') 
    5555        or diag($debugger->buffer); 
    5656} 
     
    7272 
    7373{ 
     74    my $out = $debugger->step_in; 
     75    is($out, "main::(t/eg/02-sub.pl:10):\tmy \$t = f(19, 23);\n  DB<3> ", 'out'); 
     76} 
     77 
     78{ 
     79    my @out = $debugger->step_in; 
     80    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 16, '   my ($q, $w) = @_;'], 'line 17') 
     81        or diag($debugger->buffer); 
     82} 
     83 
     84{ 
     85    my $out = $debugger->step_in; 
     86    is($out, "main::f(t/eg/02-sub.pl:17):\t   my \$multi = \$q * \$w;\n  DB<3> ", 'out'); 
     87} 
     88 
     89{ 
     90    my $out = $debugger->step_out; 
     91    is($out, "scalar context return from main::f: 437\nmain::(t/eg/02-sub.pl:11):\t\$t++;\n  DB<3> ", 'out'); 
     92} 
     93 
     94{ 
     95    my $out = $debugger->step_in; 
     96    is($out, "main::(t/eg/02-sub.pl:12):\t\$z++;\n  DB<3> ", 'out'); 
     97} 
     98 
     99{ 
    74100# Debugged program terminated.  Use q to quit or R to restart, 
    75101#   use o inhibit_exit to avoid stopping after program termination, 
  • trunk/Debug-Client/t/02-sub-step_over.t

    r9686 r9693  
    1212my $PROMPT = re('\d+'); 
    1313 
    14 plan(tests => 9); 
     14plan(tests => 12); 
    1515 
    1616my $debugger = start_debugger(); 
     
    6363} 
    6464 
     65 
     66{ 
     67    my $out = $debugger->step_over; 
     68    is($out, "main::(t/eg/02-sub.pl:10):\tmy \$t = f(19, 23);\n  DB<3> ", 'step over on simple statement'); 
     69} 
     70 
     71{ 
     72    my $out = $debugger->step_over; 
     73    is($out, "main::(t/eg/02-sub.pl:11):\t\$t++;\n  DB<3> ", 'step over in scalar context'); 
     74} 
     75 
     76{ 
     77    my @out = $debugger->step_over; 
     78    cmp_deeply(\@out, [$PROMPT, 'main::', 't/eg/02-sub.pl', 12, '$z++;'], 'line 12') 
     79        or diag($debugger->buffer); 
     80} 
     81 
    6582{ 
    6683# Debugged program terminated.  Use q to quit or R to restart, 
  • trunk/Debug-Client/t/02-sub.t

    r9680 r9693  
    1212my $PROMPT = re('\d+'); 
    1313 
    14 plan(tests => 13); 
     14plan(tests => 20); 
    1515 
    1616my $debugger = start_debugger(); 
     
    5050{ 
    5151    my @out = $debugger->step_in; 
    52     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 13, '   my ($q, $w) = @_;'], 'line 13') 
     52    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 16, '   my ($q, $w) = @_;'], 'line 16') 
    5353        or diag($debugger->buffer); 
    5454} 
     
    5656{ 
    5757    my @out = $debugger->step_in; 
    58     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 14, '   my $multi = $q * $w;'], 'line 14') 
     58    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 17, '   my $multi = $q * $w;'], 'line 17') 
    5959        or diag($debugger->buffer); 
    6060} 
     
    6262{ 
    6363    my @out = $debugger->step_in; 
    64     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 15, '   my $add   = $q + $w;'], 'line 15') 
     64    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 18, '   my $add   = $q + $w;'], 'line 18') 
    6565        or diag($debugger->buffer); 
    6666} 
     
    6868{ 
    6969    my @out = $debugger->step_in; 
    70     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 16, '   return $multi;'], 'line 16') 
     70    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 19, '   return $multi;'], 'line 19') 
    7171        or diag($debugger->buffer); 
    7272} 
     
    9090 
    9191{ 
     92    my $out = $debugger->step_in; 
     93    is($out, "main::(t/eg/02-sub.pl:10):\tmy \$t = f(19, 23);\n  DB<3> ", 'out'); 
     94} 
     95 
     96{ 
     97    my $out = $debugger->step_in; 
     98    is($out, "main::f(t/eg/02-sub.pl:16):\t   my (\$q, \$w) = \@_;\n  DB<3> ", 'out'); 
     99} 
     100 
     101{ 
     102    my $out = $debugger->step_in; 
     103    is($out, "main::f(t/eg/02-sub.pl:17):\t   my \$multi = \$q * \$w;\n  DB<3> ", 'out'); 
     104} 
     105 
     106{ 
     107    my $out = $debugger->step_in; 
     108    is($out, "main::f(t/eg/02-sub.pl:18):\t   my \$add   = \$q + \$w;\n  DB<3> ", 'out'); 
     109} 
     110 
     111 
     112{ 
     113    my $out = $debugger->step_in; 
     114    is($out, "main::f(t/eg/02-sub.pl:19):\t   return \$multi;\n  DB<3> ", 'out'); 
     115} 
     116 
     117{ 
     118    my $out = $debugger->step_in; 
     119    is($out, "main::(t/eg/02-sub.pl:11):\t\$t++;\n  DB<3> ", 'out'); 
     120} 
     121 
     122{ 
     123    my $out = $debugger->step_in; 
     124    is($out, "main::(t/eg/02-sub.pl:12):\t\$z++;\n  DB<3> ", 'out'); 
     125} 
     126 
     127 
     128{ 
    92129# Debugged program terminated.  Use q to quit or R to restart, 
    93130#   use o inhibit_exit to avoid stopping after program termination, 
  • trunk/Debug-Client/t/04-run_to_line.t

    r9680 r9693  
    4040 
    4141{ 
    42     my @out = $debugger->run(14); 
    43     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 14, '   my $multi = $q * $w;'], 'line 14') 
     42    my @out = $debugger->run(17); 
     43    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 17, '   my $multi = $q * $w;'], 'line 17') 
    4444        or diag($debugger->buffer); 
    4545} 
  • trunk/Debug-Client/t/04-run_to_sub.t

    r9680 r9693  
    4141{ 
    4242    my @out = $debugger->run('f'); 
    43     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 13, '   my ($q, $w) = @_;'], 'line 13') 
     43    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 16, '   my ($q, $w) = @_;'], 'line 16') 
    4444        or diag($debugger->buffer); 
    4545} 
  • trunk/Debug-Client/t/05-execute.t

    r9680 r9693  
    1414our $TODO; # needed becasue Test::More is required and not used 
    1515 
    16 plan(tests => 13); 
     16plan(tests => 14); 
    1717 
    1818my $debugger = start_debugger(); 
     
    8282 
    8383{ 
    84     my @out = $debugger->set_breakpoint( 't/eg/02-sub.pl', 15 ); 
     84    my @out = $debugger->set_breakpoint( 't/eg/02-sub.pl', 18 ); 
    8585    cmp_deeply(\@out, [$PROMPT, ''], 'set_breakpoint') 
    8686        or diag($debugger->buffer); 
     
    8989{ 
    9090    my @out = $debugger->run; 
    91     cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 15, '   my $add   = $q + $w;'], 'line 15') 
     91    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 18, '   my $add   = $q + $w;'], 'line 18') 
    9292        or diag($debugger->buffer); 
    9393} 
    9494 
     95# TODO maybe check if we can remove the breakpoint 
     96{ 
     97    my @out = $debugger->run; 
     98    cmp_deeply(\@out, [$PROMPT, 'main::f', 't/eg/02-sub.pl', 18, '   my $add   = $q + $w;'], 'line 18') 
     99        or diag($debugger->buffer); 
     100} 
    95101 
    96102{ 
  • trunk/Debug-Client/t/eg/02-sub.pl

    r9672 r9693  
    88my $q = f($x, $y); 
    99my $z = $x + $y; 
     10my $t = f(19, 23); 
     11$t++; 
     12$z++; 
    1013 
    1114 
Note: See TracChangeset for help on using the changeset viewer.