File: roundtrip.t

package info (click to toggle)
libcpan-changes-perl 0.500005-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,964 kB
  • sloc: perl: 988; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 569 bytes parent folder | download
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
31
32
use strict;
use warnings;

use CPAN::Changes;
use Test::More;

my $less = <<'EOF';
1.7.5 2013-08-01T09:48:11Z
 - Top Level Entry

 [Group]
 - Child Entry Line 1
 - Child Entry Line 2
EOF

my $more = <<'EOF';
1.7.5 2013-08-01T09:48:11Z
  - Top Level Entry

  [ Group ]
    - Child Entry Line 1
    - Child Entry Line 2
EOF

for my $text ($less, $more) {
  my $changes = CPAN::Changes->load_string( $text );
  my $serialize = $changes->serialize;
  is +CPAN::Changes->load_string( $serialize )->serialize, $serialize,
    'changes roundtrips correctly';
}

done_testing;