App-Chronicle
view release on metacpan or search on metacpan
t/test-html-tidy.t view on Meta::CPAN
#!/usr/bin/perl -I../lib/ -Ilib/
use strict;
use warnings;
use Test::More tests => 3;
#
# Load the module.
#
BEGIN {use_ok('Chronicle::Plugin::Tidy');}
require_ok('Chronicle::Plugin::Tidy');
#
# Create a fake blog-post
#
my %data;
$data{ 'body' } = "<P>This paragraph is unclosed";
$data{ 'title' } = "Irrelevent";
#
# Run through the plugin and verify that the input hasn't changed.
#
# (Because no "format" key exists in the hash.)
#
my $out = Chronicle::Plugin::Tidy::on_insert( undef, data => \%data );
is( $out->{ 'body' },
"<p>This paragraph is unclosed</p>",
"The trailing P was fixed" );
( run in 2.531 seconds using v1.01-cache-2.11-cpan-d8267643d1d )