File: 05_paragraphs.t

package info (click to toggle)
libtext-lorem-perl 0.34-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 124 kB
  • sloc: perl: 95; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 532 bytes parent folder | download | duplicates (2)
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
use strict;
use warnings;

use Test::More;

my $class = 'Text::Lorem';
use_ok($class);

SCALAR_CONTEXT: {
    note( 'scalar context' );

    my $object = $class->new();
    my $paragraphs = $object->paragraphs(3);
    is( split( /\n\n/, $paragraphs ), 3, 'string contains the expected number of paragraphs' );
}

LIST_CONTEXT: {
    note( 'list context' );

    my $object = $class->new();
    my @paragraphs = $object->paragraphs(3);
    is( @paragraphs, 3, 'array contains the expected number of paragraphs' );
}

done_testing();