# Copyrights 2001-2022 by [Mark Overmeer ]. # For other contributors see ChangeLog. # See the manual pages for details on the licensing terms. # Pod stripped from pm file by OODoc 2.03. # This code is part of distribution Mail-Message. Meta-POD processed with # OODoc into POD and HTML manual-pages. See README.md # Copyright Mark Overmeer. Licensed under the same terms as Perl itself. package Mail::Message::Test; use vars '$VERSION'; $VERSION = '3.012'; use base 'Exporter'; use strict; use warnings; use File::Copy 'copy'; use List::Util 'first'; use IO::File; # to overrule open() use File::Spec; use Cwd qw(getcwd); use Sys::Hostname qw(hostname); use Test::More; our @EXPORT = qw/compare_message_prints reproducable_text $raw_html_data $crlf_platform /; our $crlf_platform = $^O =~ m/mswin32/i; # # Compare the text of two messages, rather strict. # On CRLF platforms, the Content-Length may be different. # sub compare_message_prints($$$) { my ($first, $second, $label) = @_; if($crlf_platform) { $first =~ s/Content-Length: (\d+)/Content-Length: /g; $second =~ s/Content-Length: (\d+)/Content-Length: /g; } is($first, $second, $label); } # # Strip message text down the things which are the same on all # platforms and all situations. # sub reproducable_text($) { my $text = shift; my @lines = split /^/m, $text; foreach (@lines) { s/((?:references|message-id|date|content-length)\: ).*/$1/i; s/boundary-\d+/boundary-/g; } join '', @lines; } # # A piece of HTML text which is used in some tests. # our $raw_html_data = <<'TEXT'; My home page

Life according to Brian

This is normal text, but not in a paragraph.

New paragraph in a bad way. And this is just a continuation. When texts get long, they must be auto-wrapped; and even that is working already.

Silly subsection at once

and another chapter

again a section

Normal paragraph, which contains an , some italics with linebreak and code

And now for the preformatted stuff
   it should stay as it was
      even   with   strange blanks
  and indentations
And back to normal text...
  • list item 1
    1. list item 1.1
    2. list item 1.2
  • list item 2
TEXT 1;