Permalink
Browse files

Update conditional tests.

  • Loading branch information...
pjcj committed Mar 2, 2013
1 parent 4aedd08 commit 41a25834958e76506dacb1197c7892d69f9fe7b9
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_and 95.2 50.0 55.6 100.0 74.4
-Total 95.2 50.0 55.6 100.0 74.4
+tests/cond_and 95.2 50.0 50.0 100.0 71.7
+Total 95.2 50.0 50.0 100.0 71.7
------------------------------------------ ------ ------ ------ ------ ------
@@ -65,10 +65,10 @@ line err stmt bran cond sub code
43
44 11 my $p = $y & $z;
45
-46 *** 11 50 $p &&= $y;
-47 *** 11 50 $p &&= $z;
+46 *** 11 33 $p &&= $y;
+47 *** 11 33 $p &&= $z;
48 11 my $q = 1;
-49 *** 11 50 $q &&= $_;
+49 *** 11 66 $q &&= $_;
50
51 11 pas();
52 }
@@ -97,19 +97,14 @@ line err % true false branch
Conditions
----------
-and 2 conditions
-
-line err % l !l expr
------ --- ------ ------ ------ ----
-46 *** 50 11 0 $p &&= $y
-47 *** 50 11 0 $p &&= $z
-49 *** 50 0 11 $q &&= $_
-
and 3 conditions
line err % !l l&&!r l&&r expr
----- --- ------ ------ ------ ------ ----
23 *** 66 0 1 10 $y and $x[0]++
+46 *** 33 11 0 0 $p &&= $y
+47 *** 33 11 0 0 $p &&= $z
+49 *** 66 0 1 10 $q &&= $_
Covered Subroutines
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_and 96.3 50.0 55.6 100.0 78.4
-Total 96.3 50.0 55.6 100.0 78.4
+tests/cond_and 96.3 50.0 50.0 100.0 75.9
+Total 96.3 50.0 50.0 100.0 75.9
------------------------------------------ ------ ------ ------ ------ ------
@@ -69,10 +69,10 @@ line err stmt bran cond sub code
43
44 11 my $p = $y & $z;
45
-46 *** 11 50 $p &&= $y;
-47 *** 11 50 $p &&= $z;
+46 *** 11 33 $p &&= $y;
+47 *** 11 33 $p &&= $z;
48 11 my $q = 1;
-49 *** 11 50 $q &&= $_;
+49 *** 11 66 $q &&= $_;
50
51 11 pas();
52 }
@@ -101,19 +101,14 @@ line err % true false branch
Conditions
----------
-and 2 conditions
-
-line err % l !l expr
------ --- ------ ------ ------ ----
-46 *** 50 11 0 $p &&= $y
-47 *** 50 11 0 $p &&= $z
-49 *** 50 0 11 $q &&= $_
-
and 3 conditions
line err % !l l&&!r l&&r expr
----- --- ------ ------ ------ ------ ----
23 *** 66 0 1 10 $y and $x[0]++
+46 *** 33 11 0 0 $p &&= $y
+47 *** 33 11 0 0 $p &&= $z
+49 *** 66 0 1 10 $q &&= $_
Covered Subroutines
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_and 96.0 50.0 55.6 100.0 77.6
-Total 96.0 50.0 55.6 100.0 77.6
+tests/cond_and 96.0 50.0 50.0 100.0 75.0
+Total 96.0 50.0 50.0 100.0 75.0
------------------------------------------ ------ ------ ------ ------ ------
@@ -67,10 +67,10 @@ line err stmt bran cond sub code
43
44 11 my $p = $y & $z;
45
-46 *** 11 50 $p &&= $y;
-47 *** 11 50 $p &&= $z;
+46 *** 11 33 $p &&= $y;
+47 *** 11 33 $p &&= $z;
48 11 my $q = 1;
-49 *** 11 50 $q &&= $_;
+49 *** 11 66 $q &&= $_;
50
51 11 pas();
52 }
@@ -99,19 +99,14 @@ line err % true false branch
Conditions
----------
-and 2 conditions
-
-line err % l !l expr
------ --- ------ ------ ------ ----
-46 *** 50 11 0 $p &&= $y
-47 *** 50 11 0 $p &&= $z
-49 *** 50 0 11 $q &&= $_
-
and 3 conditions
line err % !l l&&!r l&&r expr
----- --- ------ ------ ------ ------ ----
23 *** 66 0 1 10 $y and $x[0]++
+46 *** 33 11 0 0 $p &&= $y
+47 *** 33 11 0 0 $p &&= $z
+49 *** 66 0 1 10 $q &&= $_
Covered Subroutines
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_or 83.9 30.0 72.3 75.0 70.9
-Total 83.9 30.0 72.3 75.0 70.9
+tests/cond_or 84.5 30.0 66.7 75.0 69.1
+Total 84.5 30.0 66.7 75.0 69.1
------------------------------------------ ------ ------ ------ ------ ------
@@ -59,7 +59,7 @@ line err stmt bran cond sub code
33 }
34 }
35
-36 1 for (0 .. 10)
+36 1 for my $i (0 .. 10)
11
37 {
38 *** 11 50 $y ||
@@ -89,17 +89,17 @@ line err stmt bran cond sub code
61
62 *** 11 33 my $p = $y || $z;
63 *** 11 33 my $q = $z || $y;
-64 11 100 my $r = $_ || "qqq";
-65 11 100 my $s = $_ || [];
+64 11 100 my $r = $i || "qqq";
+65 11 100 my $s = $i || [];
66 11 my $t = $y | $z;
67 *** 11 50 my $u = $y || 0;
68 *** 11 50 my $v = $y || undef;
69 *** 11 50 my $w = $z || 0;
70
-71 *** 11 50 $p ||= $y;
-72 *** 11 50 $p ||= $z;
-73 11 100 $x[ 6] ||= $y;
-74 *** 11 50 $x[ 7] ||= $z;
+71 *** 11 33 $p ||= $y;
+72 *** 11 33 $p ||= $z;
+73 *** 11 66 $x[ 6] ||= $y;
+74 *** 11 33 $x[ 7] ||= $z;
75 11 100 $x[ 8] ||= 1;
76 11 100 $x[ 9] ||= {};
77 11 100 $x[10] ||= \"foo";
@@ -110,13 +110,15 @@ line err stmt bran cond sub code
81 11 100 $x[14] ||= *::foo{SCALAR};
82 *** 11 50 $x[15] ||= *STDIO{IO};
83 11 100 $x[16] ||= bless {}, "XXX";
-84 11 100 $x[17] ||= <<"EOD";
-85 blah
-86 EOD
-87 *** 11 50 cond_dor(\@x) if exists &cond_dor;
-88 }
-89
-90 # print join(", ", @x), "\n";
+84 11 100 $x[17] ||= $i == 1;
+85 *** 11 33 $w ||= ref($i) eq "SCALAR";
+86 11 100 $x[18] ||= <<"EOD";
+87 blah
+88 EOD
+89 *** 11 50 cond_dor(\@x) if exists &cond_dor;
+90 }
+91
+92 # print join(", ", @x), "\n";
Branches
@@ -133,7 +135,7 @@ line err % true false branch
41 *** 50 0 11 unless $y or $x[0]++
45 *** 50 11 0 unless $z
53 *** 50 0 11 if ($z) { }
-87 *** 50 0 11 if exists &cond_dor
+89 *** 50 0 11 if exists &cond_dor
Conditions
@@ -143,15 +145,11 @@ or 2 conditions
line err % l !l expr
----- --- ------ ------ ------ ----
-64 100 10 1 $_ || 'qqq'
-65 100 10 1 $_ || []
+64 100 10 1 $i || 'qqq'
+65 100 10 1 $i || []
67 *** 50 11 0 $y || 0
68 *** 50 11 0 $y || undef
69 *** 50 0 11 $z || 0
-71 *** 50 11 0 $p ||= $y
-72 *** 50 11 0 $p ||= $z
-73 100 10 1 $x[6] ||= $y
-74 *** 50 0 11 $x[7] ||= $z
75 100 10 1 $x[8] ||= 1
76 100 10 1 $x[9] ||= {}
77 100 10 1 $x[10] ||= \('foo')
@@ -164,7 +162,7 @@ line err % l !l expr
81 100 10 1 $x[14] ||= *foo{'SCALAR'}
82 *** 50 0 11 $x[15] ||= *STDIO{'IO'}
83 100 10 1 $x[16] ||= bless({}, 'XXX')
-84 100 10 1 $x[17] ||= "blah\n"
+86 100 10 1 $x[18] ||= "blah\n"
or 3 conditions
@@ -173,6 +171,12 @@ line err % l !l&&r !l&&!r expr
41 *** 33 11 0 0 $y or $x[0]++
62 *** 33 11 0 0 $y || $z
63 *** 33 0 11 0 $z || $y
+71 *** 33 11 0 0 $p ||= $y
+72 *** 33 11 0 0 $p ||= $z
+73 *** 66 10 1 0 $x[6] ||= $y
+74 *** 33 0 0 11 $x[7] ||= $z
+84 100 9 1 1 $x[17] ||= $i == 1
+85 *** 33 0 0 11 $w ||= ref $i eq 'SCALAR'
Covered Subroutines
@@ -4,8 +4,8 @@ Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/cond_or 83.3 30.0 72.3 75.0 70.4
-Total 83.3 30.0 72.3 75.0 70.4
+tests/cond_or 83.9 30.0 66.7 75.0 68.6
+Total 83.9 30.0 66.7 75.0 68.6
------------------------------------------ ------ ------ ------ ------ ------
@@ -59,7 +59,7 @@ line err stmt bran cond sub code
33 }
34 }
35
-36 1 for (0 .. 10)
+36 1 for my $i (0 .. 10)
37 {
38 *** 11 50 $y ||
39 $x[1]++;
@@ -87,17 +87,17 @@ line err stmt bran cond sub code
61
62 *** 11 33 my $p = $y || $z;
63 *** 11 33 my $q = $z || $y;
-64 11 100 my $r = $_ || "qqq";
-65 11 100 my $s = $_ || [];
+64 11 100 my $r = $i || "qqq";
+65 11 100 my $s = $i || [];
66 11 my $t = $y | $z;
67 *** 11 50 my $u = $y || 0;
68 *** 11 50 my $v = $y || undef;
69 *** 11 50 my $w = $z || 0;
70
-71 *** 11 50 $p ||= $y;
-72 *** 11 50 $p ||= $z;
-73 11 100 $x[ 6] ||= $y;
-74 *** 11 50 $x[ 7] ||= $z;
+71 *** 11 33 $p ||= $y;
+72 *** 11 33 $p ||= $z;
+73 *** 11 66 $x[ 6] ||= $y;
+74 *** 11 33 $x[ 7] ||= $z;
75 11 100 $x[ 8] ||= 1;
76 11 100 $x[ 9] ||= {};
77 11 100 $x[10] ||= \"foo";
@@ -108,13 +108,15 @@ line err stmt bran cond sub code
81 11 100 $x[14] ||= *::foo{SCALAR};
82 *** 11 50 $x[15] ||= *STDIO{IO};
83 11 100 $x[16] ||= bless {}, "XXX";
-84 11 100 $x[17] ||= <<"EOD";
-85 blah
-86 EOD
-87 *** 11 50 cond_dor(\@x) if exists &cond_dor;
-88 }
-89
-90 # print join(", ", @x), "\n";
+84 11 100 $x[17] ||= $i == 1;
+85 *** 11 33 $w ||= ref($i) eq "SCALAR";
+86 11 100 $x[18] ||= <<"EOD";
+87 blah
+88 EOD
+89 *** 11 50 cond_dor(\@x) if exists &cond_dor;
+90 }
+91
+92 # print join(", ", @x), "\n";
Branches
@@ -131,7 +133,7 @@ line err % true false branch
41 *** 50 0 11 unless $y or $x[0]++
45 *** 50 11 0 unless $z
53 *** 50 0 11 if ($z) { }
-87 *** 50 0 11 if exists &cond_dor
+89 *** 50 0 11 if exists &cond_dor
Conditions
@@ -141,15 +143,11 @@ or 2 conditions
line err % l !l expr
----- --- ------ ------ ------ ----
-64 100 10 1 $_ || 'qqq'
-65 100 10 1 $_ || []
+64 100 10 1 $i || 'qqq'
+65 100 10 1 $i || []
67 *** 50 11 0 $y || 0
68 *** 50 11 0 $y || undef
69 *** 50 0 11 $z || 0
-71 *** 50 11 0 $p ||= $y
-72 *** 50 11 0 $p ||= $z
-73 100 10 1 $x[6] ||= $y
-74 *** 50 0 11 $x[7] ||= $z
75 100 10 1 $x[8] ||= 1
76 100 10 1 $x[9] ||= {}
77 100 10 1 $x[10] ||= \'foo'
@@ -162,7 +160,7 @@ line err % l !l expr
81 100 10 1 $x[14] ||= *foo{'SCALAR'}
82 *** 50 0 11 $x[15] ||= *STDIO{'IO'}
83 100 10 1 $x[16] ||= bless({}, 'XXX')
-84 100 10 1 $x[17] ||= "blah\n"
+86 100 10 1 $x[18] ||= "blah\n"
or 3 conditions
@@ -171,6 +169,12 @@ line err % l !l&&r !l&&!r expr
41 *** 33 11 0 0 $y or $x[0]++
62 *** 33 11 0 0 $y || $z
63 *** 33 0 11 0 $z || $y
+71 *** 33 11 0 0 $p ||= $y
+72 *** 33 11 0 0 $p ||= $z
+73 *** 66 10 1 0 $x[6] ||= $y
+74 *** 33 0 0 11 $x[7] ||= $z
+84 100 9 1 1 $x[17] ||= $i == 1
+85 *** 33 0 0 11 $w ||= ref $i eq 'SCALAR'
Covered Subroutines
Oops, something went wrong.

0 comments on commit 41a2583

Please sign in to comment.