# t/clean-event-embed.t # # Test LJ::CleanHTML::clean_event. # # Authors: # Afuna # Mark Smith # Allen Petersen # # Copyright (c) 2013 by Dreamwidth Studios, LLC. # # This program is free software; you may redistribute it and/or modify it under # the same terms as Perl itself. For a copy of the license, please reference # 'perldoc perlartistic' or 'perldoc perlgpl'. # use v5.10; use strict; use warnings; use Test::More tests => 1; BEGIN { $LJ::_T_CONFIG = 1; require "$ENV{LJHOME}/cgi-bin/ljlib.pl"; } use LJ::CleanHTML; use HTMLCleaner; # Cleaning tags within LJ::CleanHTML::clean_event pulls in LJ::Hooks # which ultimately pulls in ljlib.pl. # # Separated out into its own file so that the rest of cleaner-event.t can be # made independent of ljlib.pl my $orig_post; my $clean_post; my $clean = sub { my $opts = shift; LJ::CleanHTML::clean_event( \$orig_post, $opts ); }; # embed tags note(" and tags"); $orig_post = qq{}; $clean_post = qq{}; $clean->(); is( $orig_post, $clean_post, " and tags" );