develooper Front page | perl.perl5.porters | Postings from April 2008

Re: [PATCH] testing $/ with in memory files

Thread Previous | Thread Next
From:
Bram
Date:
April 30, 2008 02:19
Subject:
Re: [PATCH] testing $/ with in memory files
Message ID:
20080430111842.hmqi9idvwg4sc8gw@horde.wizbit.be
Quoting Rafael Garcia-Suarez <rgarciasuarez@gmail.com>:

> 2008/4/27 Bram <p5p@perl.wizbit.be>:
>> Inspired by: http://rt.perl.org/rt3/Public/Bug/Display.html?id=44833 (fixed
>> somewhere between 5.8.7 and 5.8.8)
>>
>>  But I don't think test were added for it.
>>  Attached is a patch for t/base/rs.t. (I hope this is the correct file to
>> test it...)
>
> No, it's not, sorry :)
>
> In-memory files necessitate PerlIO::via::scalar, thus a perl with
> perlio and dynaloading enabled. miniperl won't be able to run this
> test, which is not good for a test in base. I suggest a new test file
> in t/op, with all tests skipped if $ENV{PERL_CORE_MINITEST} is true.
>

That means duplicating all the rs tests...

What about adding the if at the end of t/op/rs.t?

That is:

if ($ENV{PERL_CORE_MINITESTS) {
   # skip tests
   for ($count .. $number_of_tests) {
     print "ok $_ # skipped";
   }
}
else {
   # Test if a file in memory behaves the same as a real file (=  
re-run the test with a file in memory)
   open TESTFILE, "<", \$teststring;
   test_string(*TESTFILE);
   close TESTFILE;

   open TESTFILE, "<", \$teststring2;
   test_record(*TESTFILE);
   close TESTFILE;
}

Would that be acceptable as well?


Kind regards,

Bram



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About