File Coverage

blib/lib/Mail/Message/Field/Unstructured.pm
Criterion Covered Total %
statement 19 19 100.0
branch 4 6 66.6
condition 5 6 83.3
subroutine 5 5 100.0
pod 0 1 0.0
total 33 37 89.1


line stmt bran cond sub pod time code
1             # This code is part of Perl distribution Mail-Message version 4.04.
2             # The POD got stripped from this file by OODoc version 3.06.
3             # For contributors see file ChangeLog.
4              
5             # This software is copyright (c) 2001-2026 by Mark Overmeer.
6              
7             # This is free software; you can redistribute it and/or modify it under
8             # the same terms as the Perl 5 programming language system itself.
9             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10              
11              
12             package Mail::Message::Field::Unstructured;{
13             our $VERSION = '4.04';
14             }
15              
16 28     28   1150 use parent 'Mail::Message::Field::Full';
  28         97  
  28         285  
17              
18 28     28   10806 use strict;
  28         100  
  28         892  
19 28     28   145 use warnings;
  28         75  
  28         2130  
20              
21 28     28   248 use Log::Report 'mail-message', import => [ qw/__x warning/ ];
  28         68  
  28         249  
22              
23             #--------------------
24              
25             sub init($)
26 7     7 0 20 { my ($self, $args) = @_;
27              
28 7 100 66     46 if($args->{body} && ($args->{encoding} || $args->{charset}))
      100        
29 2         18 { $args->{body} = $self->encode($args->{body}, %$args);
30             }
31              
32 7         37 $self->SUPER::init($args);
33              
34 7 50       19 ! defined $args->{attributes} or warning __x"attributes are not supported for unstructured fields.";
35 7 50       21 ! defined $args->{extra} or warning __x"no extras for unstructured fields.";
36 7         50 $self;
37             }
38              
39             #--------------------
40              
41             1;