File: 15-pod.t

package info (click to toggle)
libpod-tree-perl 1.31-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,020 kB
  • sloc: perl: 2,231; exp: 215; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 665 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
26
27
28
29
30
31
32
33
34
35
36
37
use 5.006;
use strict;
use warnings;
use Path::Tiny qw(path);
use Test::More tests => 6;

use Pod::Tree;
use Pod::Tree::Pod;

my $dir = "t/pod.d";

for my $file (qw(cut paragraph list sequence for link)) {
	my $tree = Pod::Tree->new;
	$tree->load_file("$dir/$file.pod");
	my $actual = IO::String->new;
	my $pod = Pod::Tree::Pod->new( $tree, $actual );
	$pod->translate;

	my $expected = path("$dir/$file.pod")->slurp;
	is $$actual, $expected;

	path("$dir/$file.act")->spew($$actual);
}

##no critic (RequireFilenameMatchesPackage)
package IO::String;

sub new {
	my $self = '';
	bless \$self, shift;
}

sub print {
	my $self = shift;
	$$self .= join( '', @_ );
}