Subject: | bug in test script |
There seems to be a permission problem in the 00load.t test
in Config::IniFiles 2.38 (my Perl: 5.8.0/ithreads, OS: Solaris 7/Sparc).
The test01.ini is written with permissions 222 (derived from
test.ini, which is unpacked read-only), and also opened read-only,
which gave me a bunch of errors/warnings. Here is a proposal how
to fix the test:
diff -ru Config-IniFiles-2.38/t/00load.t Config-IniFiles-2.38p/t/00load.t
--- Config-IniFiles-2.38/t/00load.t 2003-05-14 03:46:28.000000000 +0200
+++ Config-IniFiles-2.38p/t/00load.t 2003-05-15 14:42:03.000000000 +0200
@@ -69,10 +69,11 @@
if( open( CONFIG, "test.ini" ) ) {
$ini = new Config::IniFiles -file => \*CONFIG;
$ini->SetFileName( 'test01.ini' );
+ $ini->SetWriteMode( '644' );
$ini->RewriteConfig();
close CONFIG;
# Now test opening and re-write to the same handle
- if( open( CONFIG, "test01.ini" ) ) {
+ if( open( CONFIG, "+<test01.ini" ) ) {
$ini = new Config::IniFiles -file => \*CONFIG;
my $badname = scalar(\*CONFIG);
# Have to use open/close because -e seems to be always true!
@@ -81,6 +82,9 @@
# In case it failed, remove the file
# (old behavior was to write to a file whose filename is the scalar value of the handle!)
unlink $badname;
+ } else {
+ print "Cannot open test01.ini for read/write: $!\n";
+ ok( 0 );
} # end if
} else {
ok( 0 );