cap2site/t/script.pl

24 lines
497 B
Perl
Executable File

#!/usr/bin/env perl
use v5.10;
use strict;
use warnings;
sub test($$$) {
my ($cmd,$file,$expected) = @_;
my $res = readpipe($cmd . " < t/" . $file);
my $exp = do {
local $/ = undef;
open my $fh, "<", "t/" . $expected
or die "error opening file: $!";
<$fh>
};
$res eq $exp or die "FAIL: $cmd\nEXPECTED:\n$exp\nACTUAL:\n$res";
}
test("./cap2site.pod", "hello.gmi", "hello_exp.html");
test("./cap2site.pod -s", "hello.gmi", "hello_standalone_exp.html");
say "DONE!";