chiark / gitweb /
Notice if $expected_total_profit parsing failed; don't break if it is an integer
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 21 Oct 2009 23:10:33 +0000 (00:10 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 21 Oct 2009 23:10:33 +0000 (00:10 +0100)
yarrg/web/routetrade

index 68f9d27..c7dd03e 100644 (file)
@@ -533,7 +533,7 @@ if ($qa->{'debug'}) {
                        $found_section= 1;
                        next;
                }
-               if (m/^Objective:\s+totalprofit = (\d+\.\d*) /) {
+               if (m/^Objective:\s+totalprofit = (\d+(?:\.\d*)?) /) {
                        $expected_total_profit= $1;
                }
                next unless $found_section==1;
@@ -574,6 +574,7 @@ if ($qa->{'debug'}) {
        my $prerr= "\n=====\n$cplex\n=====\n$glpsol_out\n=====\n ";
        pipethrough_run_finish($output,$prerr);
        map { defined $_->{OptQty} or die "$prerr $_->{Flow}{Ix}" } @subflows;
+       defined $expected_total_profit or die "$prerr ?";
 };
 
 $addcols->({ DoReverse => 1, TotalSubflows => 1, Special => sub {