jberger / Mojolicious-Plugin-ReplyTable

Easily render rectangular data in many formats using Mojolicious
Other
4 stars 5 forks source link

t/basic.t fails on some systems #10

Open eserte opened 8 months ago

eserte commented 8 months ago

The test suite fails on some of my smokers like this:

#   Failed test '406 Not Acceptable'
#   at t/basic.t line 174.
#          got: '200'
#     expected: '406'

#   Failed test '406 Not Acceptable'
#   at t/basic.t line 192.
#          got: '200'
#     expected: '406'
# Looks like you failed 2 tests of 66.
t/basic.t .. 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/66 subtests 
    (less 10 skipped subtests: 54 okay)

It happens also for other users, see http://www.cpantesters.org/cpan/report/a29bedee-a03b-11ee-b46c-98f136964987 for an example.

Why is this so? It seems that using Test::Without::Module->import(...) does not have any effect:

$ perl5.30.3 -e 'Test::Without::Module->import("Text::Tabs"); require Text::Tabs;'
-> no error

What seems to work is a use wrapped in an eval (so it works at runtime):

$  perl5.30.3 -e 'eval q{ use Test::Without::Module ("Text::Tabs") }; require Text::Tabs;'
Can't locate Text/Tabs.pm in @INC (you may need to install the Text::Tabs module) (@INC contains: CODE(0x25680d0) /opt/perl-5.30.3/lib/site_perl/5.30.3/x86_64-linux /opt/perl-5.30.3/lib/site_perl/5.30.3 /opt/perl-5.30.3/lib/5.30.3/x86_64-linux /opt/perl-5.30.3/lib/5.30.3) at -e line 1.

This is not exactly documented in the Test::Without::Module manpage, but the opposite using no is.

eserte commented 8 months ago

However there's an unclear thing: the import/unimport approach worked somehow until 5.37.6, it seems: http://matrix.cpantesters.org/?dist=Mojolicious-Plugin-ReplyTable%200.12 So maybe additionally something in perl's internals changed...