Testing coverage of SvTRUE

Here is the coverage of Faster.xs in the module Gzip::Faster:


It suggests that most of these statements aren't tested. But actually they are, more or less.

What seems to be happening is that SvTRUE is a macro with about five or six different tests:


and so to get "coverage" of all the SvTRUEs here I'd need to send a string, an integer, a floating-point number, and so on and so on. But would that actually tell anything about Gzip::Faster? In fact it wouldn't. It would just be testing whether SvTRUE from Perl's core was working correctly or not.

Leave a comment

About Ben Bullock

user-pic Perl user since about 2006, I have also released some CPAN modules.