]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - t/24-ops.t
Complete rewrite. Make the inspect process return both the ret state and the last...
[perl/modules/Sub-Nary.git] / t / 24-ops.t
index 506b55eb0b7ee0ab34eba418db55b6d4ba00d276..9b7f97021740213766b1828f7a92b5d9aecde2ed 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 47;
+use Test::More tests => 48;
 
 use Sub::Nary;
 
@@ -36,8 +36,8 @@ sub onetwothree {
 # { 1 => 0.5, 2 => 0.5 } * 0.5 + { 2 => 0.25, 3 => 0.5, 4 => 0.25 } * 0.5
 my $exp_22 = { 1 => 0.5 * 0.5, 2 => (0.5 + 0.25) * 0.5, 3 => 0.5 * 0.5, 4 => 0.25 * 0.5 };
 
-# { 1 => 1/3, 2 => 1/3, 3 => 1/3 } * 0.5 + { 2 => 1/9, 3 => 2/9, 4 => 3/9, 5 => 2/9, 6 => 1/3 } * 0.5
-my $exp_32 = { 1 => 1/3/2, 2 => (1/3+1/9)/2, 3 => (1/3+2/9)/2, 4 => 3/9/2, 5 => 2/9/2, 6 => 1/3/2 };
+# { 1 => 0.5, 2 => 0.25, 3 => 0.25 } * 0.5 + { 2 => 0.25, 3 => 0.25, 4 => 0.3125, 5 => 0.125, 6 => 0.0625 } * 0.5
+my $exp_32 = { 1 => 0.5/2, 2 => (0.25+0.25)/2, 3 => (0.25+0.25)/2, 4 => (0.3125)/2, 5 => (0.125)/2, 6 => (0.0625)/2 };
 
 my $b3 = 0.5 ** 3;
 my $exp_23 = { 3 => $b3, 4 => 3 * $b3, 5 => 3 * $b3, 6 => $b3 };
@@ -104,7 +104,7 @@ my @tests = (
  [ sub { endprotoent }, 1 ],
  [ sub { endservent },  1 ],
 
- [ sub { <*.*> }, { list => 1 / 3, 1 => 2 / 3 } ],
+ [ sub { <*.*> }, { list => 0.5, 1 => 0.5 } ],
 );
 
 my $i = 1;