File: BodyPrint.t

package info (click to toggle)
libmime-tools-perl 5.515-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,612 kB
  • sloc: perl: 6,349; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 572 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl -w
use strict;
use warnings;
use Test::More tests => 7;

use MIME::Body;
use MIME::Tools;

my $body = MIME::Body::InCore->new("hi\n");
my $fh = $body->open("r");
my @ary = <$fh>;
$fh->close();
is(scalar(@ary), 1);
is($ary[0], "hi\n");

$body = MIME::Body::InCore->new(\"hi\n");
$fh = $body->open("r");
@ary = <$fh>;
$fh->close();
is(scalar(@ary), 1);
is($ary[0], "hi\n");

$body = MIME::Body::InCore->new(["line 1\n", "line 2\n"]);
$fh = $body->open("r");
@ary = <$fh>;
$fh->close();
is(scalar(@ary), 2);
is($ary[0], "line 1\n");
is($ary[1], "line 2\n");