#!/usr/bin/perl -w
use strict;
use lib 't';
use testlib;
sub run {
use_ok('Test::HTML::Content');
# Tests for comments
comment_ok('Mail me at some address',
'(c) 2002 corion@cpan.org', "Comments are found if there");
comment_ok('Mail me at some address',
' (c) 2002 corion@cpan.org', "Whitespace at front");
comment_ok('Mail me at some address',
' (c) 2002 corion@cpan.org ', "Whitespace at front and end");
comment_ok('Mail me at some address',
'(c) 2002 corion@cpan.org ', "Whitespace at end");
comment_ok('Mail me at some address',
'(c) 2002 corion@cpan.org', "Whitespace at HTML front");
comment_ok('Mail me at some address',
'(c) 2002 corion@cpan.org', "Whitespace at HTML end");
comment_ok('Mail me at some address',
qr'corion@cpan.org', "RE over comments");
comment_ok('Mail me at foo some address', 'corion@cpan.org', "Comments are found if there");
comment_count('Mail me at foo some address', 'corion@cpan.org',1, "Comments are found if there");
comment_count('Mail me at foo
some address', 'corion@cpan.org',2, "Comments are counted correctly");
comment_count('Mail me at foo some address', qr'\@cpan\.org',2, "RE-Comments are counted correctly");
no_comment('Mail me at (c) 2002 corion@cpan.org some address',
'(c) 2002 corion@cpan.org', "Comments are not found if not there");
no_comment('Mail me at corion@cpan.org some address',
'corion@cpan.org', "Comments are not found if not there");
no_comment('Mail me at foo some address', qr'\@cpan\.com', "RE-Comments are found correctly");
no_comment('Mail me at foo some address', qr'corion\@[c]pan\.org', "RE-Comments not stringified");
};
runtests( 1+15, \&run );