Subject: | Optional t/SQL-Shell.t tests fail if CGI and Locale::Recode are not installed |
When performing t/SQL-Shell.t against an SQLite database, three tests fail:
$ UNIT_TEST_DSN=DBI:SQLite:dbname=test.db UNIT_TEST_USER=anything UNIT_TEST_PASS='' perl -Ilib t/SQL-Shell.t
1..58
[...]
ok 28 (logging)
not ok 29 at line 136 in t/SQL-Shell.t (XML display mode)
ok 30 (Show schema)
ok 31 (Send command)
ok 32 (Recv command)
ok 33 (Wipe tables)
not ok 34 at line 163 in t/SQL-Shell.t (Check for unrecognised charset)
not ok 35 at line 166 in t/SQL-Shell.t (Loaded data with recoding)
ok 36 (Escape whitespace)
When debugging the "XML display mode" test, I can see the $output variable contains:
Can't locate CGI.pm in @INC (you may need to install the CGI module) (@INC contains: ./lib ../lib lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ../lib/SQL/Shell.pm line 858.
And indeed lib/SQL/Shell.pm:858 requires CGI:
sub _render_xml
{
my ($self, $fh, $headers, $data) = @_;
→ require CGI; #For its markup escaping routine
print $fh "<rowset>\n";
I believe SQL-Shell metadata should list CGI as a run-time dependency.
A similar issue is with the "Check for unrecognised charset" test. Locale::Recode is missing.