[svn:parrot] r42353 - in branches/auto_format_no_Config: config/auto config/init t/steps/auto
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Sun Nov 8 04:06:48 UTC 2009
Author: jkeenan
Date: Sun Nov 8 04:05:48 2009
New Revision: 42353
URL: https://trac.parrot.org/parrot/changeset/42353
Log:
Eliminate direct lookup from Perl 5 %Config. Do lookup in init::defaults and use results in auto::format. Adjust step test accordingly.
Modified:
branches/auto_format_no_Config/config/auto/format.pm
branches/auto_format_no_Config/config/init/defaults.pm
branches/auto_format_no_Config/t/steps/auto/format-01.t
Modified: branches/auto_format_no_Config/config/auto/format.pm
==============================================================================
--- branches/auto_format_no_Config/config/auto/format.pm Sun Nov 8 03:20:17 2009 (r42352)
+++ branches/auto_format_no_Config/config/auto/format.pm Sun Nov 8 04:05:48 2009 (r42353)
@@ -15,7 +15,6 @@
use strict;
use warnings;
-use Config; # for long double printf format
use base qw(Parrot::Configure::Step);
@@ -75,8 +74,9 @@
# Stay way from long double for now (it may be 64 or 80 bits)
# die "long double not supported at this time, use double.";
$nvsize = $ldsize;
- if (defined($Config{'sPRIgldbl'})) {
- $nvformat = "%.15" . $Config{'sPRIgldbl'};
+ my $spri = $conf->data->get_p5('sPRIgldbl');
+ if ( defined $spri ) {
+ $nvformat = "%.15" . $spri;
$nvformat =~ s/"//g; # Perl 5's Config value has embedded double quotes
}
else {
Modified: branches/auto_format_no_Config/config/init/defaults.pm
==============================================================================
--- branches/auto_format_no_Config/config/init/defaults.pm Sun Nov 8 03:20:17 2009 (r42352)
+++ branches/auto_format_no_Config/config/init/defaults.pm Sun Nov 8 04:05:48 2009 (r42353)
@@ -59,6 +59,7 @@
sig_name
scriptdirexp
use64bitint
+ sPRIgldbl
| ) {
$conf->data->set_p5( $orig => $Config{$orig} );
}
Modified: branches/auto_format_no_Config/t/steps/auto/format-01.t
==============================================================================
--- branches/auto_format_no_Config/t/steps/auto/format-01.t Sun Nov 8 03:20:17 2009 (r42352)
+++ branches/auto_format_no_Config/t/steps/auto/format-01.t Sun Nov 8 04:05:48 2009 (r42353)
@@ -5,9 +5,10 @@
use strict;
use warnings;
-use Test::More tests => 16;
+use Test::More tests => 21;
use Carp;
use lib qw( lib t/configure/testlib );
+use_ok('config::init::defaults');
use_ok('config::auto::format');
use Parrot::BuildUtil;
use Parrot::Configure;
@@ -26,6 +27,8 @@
my $conf = Parrot::Configure->new();
+test_step_thru_runstep( $conf, q{init::defaults}, $args );
+
my ($task, $step_name, $step, $ret);
my $pkg = q{auto::format};
@@ -97,15 +100,14 @@
);
}
{
- use Config;
- my $p5format = '%.15' . $Config{sPRIgldbl};
+ my $p5format = '%.15' . $conf->data->get_p5('sPRIgldbl');
$p5format =~ s/"//g;; # Perl 5's Config value has embedded double quotes
$conf->data->set( nv => 'long double' );
auto::format::_set_floatvalfmt_nvsize($conf);
is($conf->data->get( 'floatvalfmt' ), $p5format,
- "floatvalfmt set as expected");
+ "floatvalfmt set as expected: nv long double");
is($conf->data->get( 'nvsize' ), $conf->data->get( 'hugefloatvalsize' ),
- "nvsize set as expected");
+ "nvsize set as expected: nv long double");
$conf->data->set(
nv => undef,
floatvalfmt => undef,
More information about the parrot-commits
mailing list