1use strict;
2use warnings;
3use Test::More tests => 2;
4
5#use Test::Differences qw(eq_or_diff);
6use File::Temp qw(tempdir);
7use Path::Tiny qw(path);
8
9my $dir = tempdir( CLEANUP => 1 );
10
11subtest usage => sub {
12	plan tests => 1;
13	my $out = qx{$^X script/trac2html};
14	like $out, qr{Usage: script/trac2html};
15
16	#diag $out;
17};
18
19#	padre_download_debian
20#	padre_download_fedora
21#	padre_download_mandriva
22#	padre_download_opensuse
23#	padre_download_ubuntu
24#	padre_download_netbsd
25#	padre_development
26my @cases = qw(
27	padre_download_freebsd
28	padre_features
29);
30
31# Ubuntu generates warnings
32subtest full_html => sub {
33	plan tests => 2 * @cases;
34	foreach my $case (@cases) {
35		my $out = qx{$^X script/trac2html --infile t/corpus/$case.trac --outfile $dir/$case.html --span};
36		is $out, '', 'out';
37		my $html_generated = path("$dir/$case.html")->slurp_utf8;
38		my $html_expected  = path("t/expected/${case}_noclass_noid.html")->slurp_utf8;
39
40		#eq_or_diff $html_generated, $html_expected, 'Mandriva';
41		is $html_generated, $html_expected, $case;
42	}
43};
44
45