
# http://rt.cpan.org/Public/Bug/Display.html?id=32355

use Test::More tests => 7;

BEGIN { use_ok 'HTML::Strip' }

# stripping declarations
{
  my $hs = HTML::Strip->new();
  is( $hs->parse( q{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>Text</html>} ),
      "Text", 'decls are stripped' );
  $hs->eof;
}

# stripping comments
{
  my $hs = HTML::Strip->new();
  is( $hs->parse( q{<html><!-- a comment to be stripped -->Hello World!</html>} ),
      "Hello World!", "comments are stripped" );
  $hs->eof;

  is( $hs->parse( q{<html><!-- comment with a ' apos -->Hello World!</html>} ), 
     "Hello World!", q{comments may contain '} );
  $hs->eof;

  is( $hs->parse( q{<html><!-- comment with a " quote -->Hello World!</html>} ), 
     "Hello World!", q{comments may contain "} );
  $hs->eof;

  is( $hs->parse( q{<html><!-- comment -- "quote" >Hello World!</html>} ), 
     "Hello World!", "weird decls are stripped" );
  $hs->eof;

  is( $hs->parse( "a<>b" ),
      "a b", 'edge case with <> ok' );

}
