---
name: "Test::TAP::Model::File"
section: "3pm"
platform: "linux"
package: "libtest-tap-model-perl"
version: "0.09-1"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/Test::TAP::Model::File"
---

# Test::TAP::Model::File(3pm)

Test::TAP::Model::File - an object representing the TAP results of a single test script's output.

```
        my $f = ( $t->test_files )[0];

        if ($f->ok){ # et cetera
                print "happy happy joy joy!";
        }
```

This is a convenience object, which is more of a library of questions you can ask about the hash structure described in Test::TAP::Model. It's purpose is to help you query status concisely, probably from a templating kit.\
 **Miscelleneous** This constructor accepts a hash like you can find in the return value of "structure" in Test::TAP::Model.

It does not bless that structure to stay friendly with others. Instead it blesses a scalar reference to it. This returns the name of the class used to construct subtest objects using methods like ok\_tests.\
 **Predicates About the File** Whether the file as a whole passed Or failed Whether skip\_all was done at some point Whether test bailed out\
 **Misc info** The name of the test file.\
 **Methods for Extracting Subtests** In scalar context, a number, in list context, a list of Test::TAP::Model::Subtest objects

This value is somewhat massaged, with stubs created for planned tests which were never reached. This method returns the same thing as `"cases"` and friends, but without the stubs. Just a number, of the expected test count. Subtests which passed Duh. Same list/scalar context sensitivity applies. Subtests marked TODO. Test which are vegeterian. Please tell me you're not really reading these decriptions. The're really only to get the =items sepeared in whatever POD viewer you are using.\
 **Statistical goodness** OK/(max seen, planned) Pretty printed ratio in percentage, with two decimal points and a percent sign. Any diagnosis output seen in TAP that came before a subtest.
