~ubuntu-branches/ubuntu/trusty/libdata-ical-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/02.linewrap.t

  • Committer: Bazaar Package Importer
  • Author(s): Peter Makholm
  • Date: 2007-12-04 07:39:22 UTC
  • Revision ID: james.westby@ubuntu.com-20071204073922-mosdr2aj4ks656xz
Tags: upstream-0.13+dfsg
ImportĀ upstreamĀ versionĀ 0.13+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
 
 
3
use warnings;
 
4
use strict;
 
5
 
 
6
use Test::More tests => 7;
 
7
use Test::LongString;
 
8
 
 
9
BEGIN { use_ok('Data::ICal::Entry::Todo') }
 
10
 
 
11
my $todo = Data::ICal::Entry::Todo->new;
 
12
isa_ok($todo, 'Data::ICal::Entry::Todo');
 
13
 
 
14
my $hundreds_of_characters = "X" x 300;
 
15
 
 
16
is(length $hundreds_of_characters, 300);
 
17
cmp_ok(length $hundreds_of_characters, '>', 75, "the summary is bigger than the suggested line-wrap");
 
18
 
 
19
$todo->add_property(summary => $hundreds_of_characters);
 
20
 
 
21
lacks_string($todo->as_string, $hundreds_of_characters, "the long string isn't there");
 
22
unlike_string($todo->as_string, qr/.{76}/, "no lines are too long");
 
23
 
 
24
 
 
25
like_string($todo->as_string(fold => 0), qr/.{300}/, "no lines are too long".$todo->as_string(fold=>0));