[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    t/op/grep.t one-sided tests
From:       David Landgren <david () landgren ! net>
Date:       2006-04-29 12:42:20
Message-ID: 44535F2C.7050909 () landgren ! net
[Download RAW message or body]

t/op/grep.t contains some oddities like:

    print map({$_} ("ok $test\n"));
    $test++;

    print map
             ({$_} ("ok $test\n"));
    $test++;

This is all very well if the tests succeed, but if they fail, the only 
indication will be that the test counts at the end of the run will be 
off by one (or how ever many), but you're on your own as to figuring out 
which test failed. What is being tested here? Is the following equivalent?

     my $orig = 'lazar';
     my ($result) = map({$_} ($orig));
     cmp_ok($orig,'eq',$result,'whatever');

(or maybe @result, if it's a question of scalar/list context?)

Thanks,
David
-- 
hope still, a little resistance always maybe stubborn tiny lights vs. 
clustering darkness forever ok?
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic