Attempting to make a basic test using Test::More, on a file named test.tap:
use Test::More tests => 2;
is( 1, 1 );
is( 2, 2 );
Running prove against this test causes a failure:
$ prove test.tap
test.tap .. No subtests run
Test Summary Report
-------------------
test.tap (Wstat: 0 Tests: 0 Failed: 0)
Parse errors: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU)
But Perl gives a seemingly valid TAP output:
$ perl test.tap
1..2
ok 1
ok 2
The prove version is:
$ prove --version
TAP::Harness v3.35 and Perl v5.22.1
Additionally, I found that adding a shebang #! on the test file causes test results to pass intermittently
#!/usr/bin/perl
use Test::More tests => 2;
is( 1, 1 );
is( 2, 2 );
On success (passes ~1 time in 4):
t/test.tap .. ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.01 cusr 0.00 csys = 0.04 CPU)
Result: PASS
I have also found that renaming the file to test.t causes the test to pass every time.
In attempting to find a bug in an old version, I have replicated this issue on a fresh DigitalOcean Droplet running Ubuntu 16.04.2, and a Debian 8 host with TAP::Harness v3.36_01 and Perl v5.24.1.
I'm hoping to avoid "Rename all files to .t extension" being the answer. I am uncertain what TAP::Harness considers to be the difference between those two extensions, and cannot find any documentation or where in the source code that distinction is made.
Any clarification on what is happening is greatly appreciated.