next prev What Works Slide #88

Set of scalars -> collection (After)

    sub _run_all_tests {
        my(@tests) = @_;
        local($|) = 1;
        my(%failedtests);
        # Test-wide totals.
        my(%tot) = (
                    bonus    => 0,              # $totbonus
                    max      => 0,              # $totmax
                    ok       => 0,              # $totok
                    files    => 0,              # $files
                    bad      => 0,              # $bad
                    good     => 0,              # $good
                    tests    => scalar @tests,  # @tests
                    sub_skipped  => 0,          # $subtests_skipped
                    skipped  => 0,              # $tests_skipped
                   );
        ...
        foreach my $file (@tests) {
            ...
            # state of the current test.
            my %test = (
                        ok          => 0,       # $ok
                        'next'      => 0,       # $next
                        max         => 0,       # $max
                        failed      => [],      # @failed
                        todo        => {},      # %todo
                        bonus       => 0,       # $bonus
                        skipped     => 0,       # $skipped
                        skip_reason => undef,   # $skip_reason
                       );
            ...
        }


next prev ToC Copyright © 2002-2003 Norman Nunley & Michael G Schwern