Subject: | Many (all?) of this module's tests are not properly defined |
The reason the tests are not properly defined is that they don't test
the complete behavior of the print function.
For example, the first test in t/combined_is.t (all 3 releases) asserts
printing the string "TEST OUT\n" is the string "TEST OUT\n". At first
glance, this appears to be a good test definition.
But the print function interprets line endings relative to its port. On
MSWin32 it should compare it to "TEST OUT\015\012", on non-Mac *NIX
ports it should compare it to "TEST OUT\012", and on Mac ports it should
compare it to "TEST OUT\015". See "perldoc perlport" for more detail.
I doubt that Sorichetti meant to impose this problem and so I recommend
that all tests be modified to remove the line ending characters. W.r.t.
the aforementioned test, here is what I think it should look like:
check_test( sub {
combined_is(sub {
print "TEST OUT";
},
"TEST OUT",
'Testing STDOUT'
)
},{
ok => 1,
name => 'Testing STDOUT',
diag => '',
},'STDOUT matches success'
);
But even if Sorichetti meant to handle line endings, we might be able to
address it in a port independent way by setting $/ to a fixed value
before the tests begin.
And, of course, if Sorichetti meant to handle line endings natively
(which I doubt), then we can create a test data folder to hold files for
each supported port (i.e., $^O).
Upon agreement, I'll provide the patch.