SYNOPSIS

       use Test::More;
       use Test::BOM

       string_has_bom("\x00\x00\xfe\xff");
       string_hasnt_bom("blargh");

       file_has_bom('t/data/foo');
       file_hasnt_bom('t/data/bar');

DESCRIPTION

   This module helps you with testing for byte-order-marks in strings and
   files.

   If you came across this module while looking for other ways to deal
   with byte-order-marks you might find what you need in the "SEE ALSO"
   section below.

   If you don't know anything about automated testing in Perl then you
   should read about Test::More before preceding. This module uses the
   Test::Builder framework.

   Byte-order-marks are by definition to be found at the beginning of any
   content, so the functions this module provides take a look at the start
   of either a string or a file. It does this by using functions from
   String::BOM and basically just wraps them for use with Test::Builder.

   By default the following functions are imported into your namespace:
   string_has_bom, string_hasnt_bom, file_has_bom, file_hasnt_bom.

FUNCTIONS

string_has_bom ($string)

   Passes if the string has a BOM, fails if not.

string_hasnt_bom ($string)

   Passes if string doesn't have a BOM, fails if it has.

file_has_bom ($filename)

   Passes if the file has a BOM, fails if it doesn't.

file_hasnt_bom ($filename)

   Passes if the file doesn't have a BOM, fails if it has.

SEE ALSO

   There are some distributions that help you dealing with BOMs in
   different ways:

   String::BOM is used by this module to check for BOM.

   File::BOM::Utils contains functions to check for, add and remove BOM
   from files.

   File::BOM can be used to actually read from files that have BOMs as
   seamlessly as possible.

   PPI::Token::BOM represents a BOM when using PPI to parse perl.

   The distribution Dist::Zilla::Plugin::Web contains the module
   Dist::Zilla::Plugin::Web::StripBOM that strips BOM from files.

   Additional information about BOM and it's usage:

   http://www.unicode.org/faq/utf_bom.html#BOM is the FAQ for the BOM from
   the Unicode Consortium.

   https://docs.microsoft.com/de-de/windows/desktop/Intl/using-byte-order-marks
   explains how Microsoft wants the BOM to be used. Since this document
   dates from 2018 (as of this writing) it's very likely to get in contact
   with files containing BOM.