My June assignment for The CPAN Pull Request Challenge is File::LibMagic. The module fails exclusively on OpenBSD, and the test suite never passes on it. The problem seems to be the same every time:
# Failed test 'got expected info for symlink to PDF' # at t/constructor-params.t line 27. # Structures begin differing at: # $got->{mime_with_encoding} = 'application/pdf; charset=unkn +own' # $expected->{mime_with_encoding} = 'application/pdf; charset=bina +ry'

Is it just a difference between libmagic on OpenBSD and other systems? If so, could the test be fixed with

my $encoding = 'openbsd' eq $^O ? 'unknown' : 'binary'; is_deeply( $info, { description => 'PDF document, version 1.4', mime_type => 'application/pdf', encoding => $encoding, mime_with_encoding => 'application/pdf; charset=' . $encod +ing, }, 'got expected info for symlink to PDF' );

Or is the encoding of a PDF something that could break dependent code?

Bonus points

Some of the tests also end prematurely

error calling magic_file: zlib: (null) at /home/cpan/pit/bare/conf/per +l-5.12.4/.cpanplus/5.12.4/build/File-LibMagic-1.12/blib/lib/File/LibM +agic.pm line 107. # Tests were run but no plan was declared and done_testing() was not s +een. # Looks like your test exited with 79 just after 2.

Again, does it mean that zlib on OpenBSD isn't installed by default, unlike other OSes? How could one solve the problem?

Answers from OpenBSD users most welcome.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

In reply to File::LibMagic's tests fail on OpenBSD by choroba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.