commit perl-HTML-Tidy for openSUSE:Factory
Hello community, here is the log from the commit of package perl-HTML-Tidy for openSUSE:Factory checked in at 2013-09-29 17:50:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-HTML-Tidy (Old) and /work/SRC/openSUSE:Factory/.perl-HTML-Tidy.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "perl-HTML-Tidy" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-HTML-Tidy/perl-HTML-Tidy.changes 2012-12-08 15:52:42.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-HTML-Tidy.new/perl-HTML-Tidy.changes 2013-09-29 17:50:59.000000000 +0200 @@ -1,0 +2,12 @@ +Thu Sep 26 08:31:21 UTC 2013 - pgajdos@suse.com + +- updated to 1.56 + * webtidy's version statement now shows the version number of + the underlying tidyp library. + * Fixed an undef warning in parse(). Thanks, Vladimir Timofeev. + * utf8 was never encoded correctly. Thanks, Vladimir Timofeev + and Alistair Francis. + * The ->parse() method would sometimes return false even though + everything worked fine. Thanks, @sebaer. + +------------------------------------------------------------------- Old: ---- HTML-Tidy-1.54.tar.gz New: ---- HTML-Tidy-1.56.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-HTML-Tidy.spec ++++++ --- /var/tmp/diff_new_pack.LYwcIT/_old 2013-09-29 17:51:02.000000000 +0200 +++ /var/tmp/diff_new_pack.LYwcIT/_new 2013-09-29 17:51:02.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-HTML-Tidy # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: perl-HTML-Tidy -Version: 1.54 +Version: 1.56 Release: 0 %define cpan_name HTML-Tidy Summary: (X)HTML validation in a Perl object ++++++ HTML-Tidy-1.54.tar.gz -> HTML-Tidy-1.56.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/Changes new/HTML-Tidy-1.56/Changes --- old/HTML-Tidy-1.54/Changes 2010-09-17 07:45:20.000000000 +0200 +++ new/HTML-Tidy-1.56/Changes 2013-09-22 23:39:51.000000000 +0200 @@ -1,5 +1,22 @@ Revision history for Perl extension HTML::Tidy. +1.56 Sun Sep 22 16:39:40 CDT 2013 +==================================== +[ENHANCEMENTS] +webtidy's version statement now shows the version number of the underlying +tidyp library. + +[FIXES] +Fixed an undef warning in parse(). Thanks, Vladimir Timofeev. + +utf8 was never encoded correctly. Thanks, Vladimir Timofeev and Alistair +Francis. + +The ->parse() method would sometimes return false even though everything +worked fine. Thanks, @sebaer. + + + 1.54 Fri Sep 17 00:44:36 CDT 2010 ==================================== Please note that the bug tracker for HTML::Tidy is now at diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/MANIFEST new/HTML-Tidy-1.56/MANIFEST --- old/HTML-Tidy-1.54/MANIFEST 2010-09-17 07:47:11.000000000 +0200 +++ new/HTML-Tidy-1.56/MANIFEST 2013-09-23 00:33:18.000000000 +0200 @@ -26,6 +26,7 @@ t/too-many-titles.t t/unicode.html t/unicode.t +t/unicode-nbsp.t t/venus.cfg t/venus.html t/venus.t @@ -33,4 +34,5 @@ t/wordwrap.cfg t/wordwrap.t Tidy.xs -META.yml Module meta-data (added by MakeMaker) +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/META.json new/HTML-Tidy-1.56/META.json --- old/HTML-Tidy-1.54/META.json 1970-01-01 01:00:00.000000000 +0100 +++ new/HTML-Tidy-1.56/META.json 2013-09-23 00:33:18.000000000 +0200 @@ -0,0 +1,59 @@ +{ + "abstract" : "(X)HTML validation in a Perl object", + "author" : [ + "Andy Lester <andy@petdance.com>" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621", + "license" : [ + "artistic_2" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "HTML-Tidy", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "runtime" : { + "requires" : { + "Carp" : 0, + "Exporter" : 0, + "Test::Builder" : 0, + "Test::More" : "0.98", + "constant" : 0, + "overload" : 0, + "perl" : "5.008" + } + } + }, + "release_status" : "stable", + "resources" : { + "bugtracker" : { + "web" : "http://github.com/petdance/html-tidy/issues" + }, + "homepage" : "http://github.com/petdance/html-tidy", + "license" : [ + "http://www.opensource.org/licenses/artistic-license-2.0.php" + ], + "repository" : { + "url" : "http://github.com/petdance/html-tidy" + } + }, + "version" : "1.56" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/META.yml new/HTML-Tidy-1.56/META.yml --- old/HTML-Tidy-1.54/META.yml 2010-09-17 07:47:11.000000000 +0200 +++ new/HTML-Tidy-1.56/META.yml 2013-09-23 00:33:18.000000000 +0200 @@ -1,33 +1,33 @@ ---- #YAML:1.0 -name: HTML-Tidy -version: 1.54 -abstract: (X)HTML validation in a Perl object +--- +abstract: '(X)HTML validation in a Perl object' author: - - Andy Lester <andy@petdance.com> -license: artistic_2 -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 + - 'Andy Lester <andy@petdance.com>' build_requires: - ExtUtils::MakeMaker: 0 + ExtUtils::MakeMaker: 0 +configure_requires: + ExtUtils::MakeMaker: 0 +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621' +license: artistic_2 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: HTML-Tidy +no_index: + directory: + - t + - inc requires: - Carp: 0 - constant: 0 - Exporter: 0 - overload: 0 - perl: 5.008 - Test::Builder: 0 - Test::More: 0 + Carp: 0 + Exporter: 0 + Test::Builder: 0 + Test::More: 0.98 + constant: 0 + overload: 0 + perl: 5.008 resources: - bugtracker: http://github.com/petdance/html-tidy/issues - homepage: http://github.com/petdance/html-tidy - license: http://www.opensource.org/licenses/artistic-license-2.0.php - Repository: http://github.com/petdance/html-tidy -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version 6.56 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + bugtracker: http://github.com/petdance/html-tidy/issues + homepage: http://github.com/petdance/html-tidy + license: http://www.opensource.org/licenses/artistic-license-2.0.php + repository: http://github.com/petdance/html-tidy +version: 1.56 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/Makefile.PL new/HTML-Tidy-1.56/Makefile.PL --- old/HTML-Tidy-1.54/Makefile.PL 2010-09-17 07:45:59.000000000 +0200 +++ new/HTML-Tidy-1.56/Makefile.PL 2013-09-22 23:58:55.000000000 +0200 @@ -31,15 +31,13 @@ It seems that you don't have tidyp installed. HTML::Tidy does no real work on its own. It's just a wrapper aound tidyp. -HTML::Tidy is only tested to work with tidyp hosted at -http://github.com/petdance/tidyp. This is mostly the same as the one -at http://tidy.sourceforge.net/, with some changes, such as adding a -version number so that we can tell what version we're working with. +Please read the README.markdown file for details on how to install. -If you do have tidyp installed, and I just haven't detected it, +If you do have tidyp installed, but Makefile.PL can't detect it, go ahead and try building. If HTML::Tidy builds and tests correctly, -then please let Andy Lester know at andy@petdance.com so that he can -fix the library detection code. +please file a ticket at Github at +http://github.com/petdance/html-tidy/issues. so we can fix the +library detection code. EOF } @@ -63,7 +61,7 @@ ABSTRACT_FROM => 'lib/HTML/Tidy.pm', PREREQ_PM => { 'Exporter' => 0, - 'Test::More' => 0, + 'Test::More' => '0.98', # For subtest() 'Test::Builder' => 0, 'Carp' => 0, 'overload' => 0, @@ -85,10 +83,10 @@ license => 'http://www.opensource.org/licenses/artistic-license-2.0.php', homepage => 'http://github.com/petdance/html-tidy', bugtracker => 'http://github.com/petdance/html-tidy/issues', - Repository => 'http://github.com/petdance/html-tidy', + repository => 'http://github.com/petdance/html-tidy', } }; - $parms->{LICENSE} = 'artistic_2', + $parms->{LICENSE} = 'artistic_2'; } if ( $ExtUtils::MakeMaker::VERSION ge '6.47_02' ) { $parms->{MIN_PERL_VERSION} = 5.008; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/README.markdown new/HTML-Tidy-1.56/README.markdown --- old/HTML-Tidy-1.54/README.markdown 2010-09-17 06:42:59.000000000 +0200 +++ new/HTML-Tidy-1.56/README.markdown 2012-07-07 06:08:57.000000000 +0200 @@ -1,23 +1,37 @@ HTML::Tidy ========== HTML::Tidy is an HTML checker in a handy dandy object. It's meant as -a replacement for HTML::Lint. +a replacement for [HTML::Lint] [1], which is written in Perl but is not +nearly as capable as HTML::Tidy. -INSTALLING TIDYP -================ -You need the tidyp library to build HTML::Tidy. If you -haven't installed it, you can get a source distribution at -[Github](http://github.com/petdance/tidyp/downloads). +PREREQUISITES +============= +HTML::Tidy does very little work. The real work of HTML::Tidy is +done by the tidyp library, which is written in C. To use HTML::Tidy, +you must install tidyp. -You can also try installing the CPAN module Alien::Tidyp, which -encapsulates the tidyp installation. +There are two, perhaps three, ways to install tidyp: + +* Get a tarball from the [tidyp source distributions] [2] from +Github and and build it like any other C library. Note that you +must get a source tarball, *not* just clone the source tree via +github. + +* Install the [Alien::Tidyp] [3] Perl module, which automates the +tidyp installation process. + +* Your operating system may also have a package for tidyp that you +can install. I am not aware of any packages at this writing, but +they could still exist without me knowing. + +You need only do one of these steps. INSTALLATION ============ -Once you have libtidyp installed, install HTML::Tidy like any standard -Perl module. +Once you have libtidyp installed via one of the previous methods, +install HTML::Tidy like any standard Perl module. perl Makefile.PL make @@ -31,3 +45,7 @@ This library is free software. It may be redistributed and modified under the Artistic License v2.0. + + [1]: http://search.cpan.org/dist/HTML-Lint/ "HTML::Lint" + [2]: http://github.com/petdance/tidyp/downloads "tidyp source distributions" + [3]: http://search.cpan.org/dist/Alien-Tidyp/ "Alien::Tidyp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/Tidy.xs new/HTML-Tidy-1.56/Tidy.xs --- old/HTML-Tidy-1.54/Tidy.xs 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/Tidy.xs 2012-07-07 06:15:19.000000000 +0200 @@ -137,11 +137,11 @@ } if ( rc >= 0 ) { - rc = tidySetErrorBuffer( tdoc, &errbuf ); // Capture diagnostics + rc = tidySetErrorBuffer( tdoc, &errbuf ); /* Capture diagnostics */ } if ( rc >= 0 ) { - rc = tidyParseString( tdoc, input ); // Parse the input + rc = tidyParseString( tdoc, input ); /* Parse the input */ } if ( rc >= 0 ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/bin/webtidy new/HTML-Tidy-1.56/bin/webtidy --- old/HTML-Tidy-1.54/bin/webtidy 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/bin/webtidy 2013-09-22 23:43:57.000000000 +0200 @@ -9,17 +9,17 @@ my $help; my $context; -my $tidy = new HTML::Tidy; +my $tidy = HTML::Tidy->new; GetOptions( - 'help' => \$help, + 'help|version' => \$help, 'context:i' => \$context, 'noerrors' => sub { $tidy->ignore( type => [ TIDY_ERROR ] ) }, 'nowarnings' => sub { $tidy->ignore( type => [ TIDY_WARNING ] ) }, ) or $help = 1; if ( !@ARGV || $help ) { - print "webtidy v$HTML::Tidy::VERSION\n"; + print "webtidy v$HTML::Tidy::VERSION using tidyp v" . HTML::Tidy::tidyp_version() . "\n"; print <DATA>; exit 1; } @@ -28,8 +28,7 @@ for my $url ( @ARGV ) { my @lines; if ( $url =~ /^https?:/ ) { - eval { require LWP::Simple }; - if ( $@ ) { + if ( !eval { require LWP::Simple; 1; } ) { warn q{Can't retrieve URLs without LWP::Simple installed}; next; } @@ -77,3 +76,6 @@ --nowarnings Ignore warnings --help This message + +webtidy is free software. You may modify or distribute it under the +terms of the Artistic License v2.0. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/lib/HTML/Tidy/Message.pm new/HTML-Tidy-1.56/lib/HTML/Tidy/Message.pm --- old/HTML-Tidy-1.54/lib/HTML/Tidy/Message.pm 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/lib/HTML/Tidy/Message.pm 2013-09-22 23:13:50.000000000 +0200 @@ -137,12 +137,12 @@ sub text { my $self = shift; return $self->{_text} } -=head1 LICENSE +=head1 COPYRIGHT & LICENSE -This code may be distributed under the same terms as Perl itself. +Copyright 2005-2013 Andy Lester. -Please note that these modules are not products of or supported by the -employers of the various contributors to the code. +This program is free software; you can redistribute it and/or modify +it under the terms of the Artistic License v2.0. =head1 AUTHOR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/lib/HTML/Tidy.pm new/HTML-Tidy-1.56/lib/HTML/Tidy.pm --- old/HTML-Tidy-1.54/lib/HTML/Tidy.pm 2010-09-17 07:35:19.000000000 +0200 +++ new/HTML-Tidy-1.56/lib/HTML/Tidy.pm 2013-09-23 00:01:17.000000000 +0200 @@ -13,18 +13,18 @@ =head1 VERSION -Version 1.54 +Version 1.56 =cut -our $VERSION = '1.54'; +our $VERSION = '1.56'; =head1 SYNOPSIS use HTML::Tidy; my $tidy = HTML::Tidy->new( {config_file => 'path/to/config'} ); - $tidy->ignore( type => TIDY_WARNING, typed => TIDY_INFO ); + $tidy->ignore( type => TIDY_WARNING, type => TIDY_INFO ); $tidy->parse( "foo.html", $contents_of_foo ); for my $message ( $tidy->messages ) { @@ -223,14 +223,12 @@ } my $html = join( '', @_ ); - utf8::encode($html) unless utf8::is_utf8($html); - my ($errorblock,$newline) = _tidy_messages( $html, - $self->{config_file}, - $self->{tidy_options} - ); + utf8::encode($html) if utf8::is_utf8($html); + my ($errorblock,$newline) = _tidy_messages( $html, $self->{config_file}, $self->{tidy_options} ); + return 1 unless defined $errorblock; + utf8::decode($errorblock); - return unless defined $errorblock; return !$self->_parse_errors($filename, $errorblock, $newline); } @@ -308,7 +306,7 @@ } my $text = join( '', @_ ); - utf8::encode($text) unless utf8::is_utf8($text); + utf8::encode($text) if utf8::is_utf8($text); if ( defined $text ) { $text .= "\n"; } @@ -352,7 +350,7 @@ =cut # backcompat -sub libtidyp_version { shift->tidyp_version } +sub libtidyp_version { return shift->tidyp_version } sub tidyp_version { my $version_str = _tidyp_version(); @@ -369,14 +367,14 @@ =head1 INSTALLING TIDYP -L<HTML::Tidy|HTML::Tidy> requires that C<tidyp> be installed on your system. +C<HTML::Tidy> requires that C<tidyp> be installed on your system. You can obtain tidyp through your distribution's package manager (make sure you install the development package with headers), or from the tidyp Git repository at L<http://github.com/petdance/tidyp>. =head1 CONVERTING FROM C<HTML::Lint> -L<HTML::Tidy|HTML::Tidy> is different from L<HTML::Lint|HTML::Lint> in a number of crucial ways. +C<HTML::Tidy> is different from C<HTML::Lint> in a number of crucial ways. =over 4 @@ -449,7 +447,7 @@ =head1 COPYRIGHT & LICENSE -Copyright (C) 2005-2010 by Andy Lester +Copyright (C) 2005-2013 by Andy Lester This library is free software. You mean modify or distribute it under the Artistic License v2.0. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/perlcriticrc new/HTML-Tidy-1.56/perlcriticrc --- old/HTML-Tidy-1.54/perlcriticrc 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/perlcriticrc 2013-09-23 00:14:59.000000000 +0200 @@ -1,20 +1,35 @@ [-CodeLayout::ProhibitParensWithBuiltins] [CodeLayout::ProhibitHardTabs] allow_leading_tabs = 0 +[-CodeLayout::RequireTidyCode] +# Never works for me. + +[Compatibility::PodMinimumVersion] +above_version = 5.008008 [-ControlStructures::ProhibitPostfixControls] +[-Documentation::PodSpelling] [-Documentation::RequirePodAtEnd] [-Documentation::RequirePodSections] +[-InputOutput::RequireCheckedSyscalls] +functions = open opendir read readline readdir close closedir + [-Miscellanea::RequireRcsKeywords] [-Modules::RequireVersionVar] +[-RegularExpressions::ProhibitEscapedMetacharacters] +[-RegularExpressions::RequireDotMatchAnything] [-RegularExpressions::RequireExtendedFormatting] [-RegularExpressions::RequireLineBoundaryMatching] +[Subroutines::RequireArgUnpacking] + [-ValuesAndExpressions::ProhibitConstantPragma] +[-ValuesAndExpressions::ProhibitNoisyQuotes] [-ValuesAndExpressions::ProhibitEmptyQuotes] +[-ValuesAndExpressions::ProhibitMagicNumbers] [-Variables::ProhibitPunctuationVars] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/00-load.t new/HTML-Tidy-1.56/t/00-load.t --- old/HTML-Tidy-1.54/t/00-load.t 2010-09-17 05:21:10.000000000 +0200 +++ new/HTML-Tidy-1.56/t/00-load.t 2013-09-22 22:57:22.000000000 +0200 @@ -1,16 +1,12 @@ -#!perl -Tw +#!perl -T use strict; use warnings; -use Test::More tests => 2; -BEGIN { - use_ok( 'HTML::Tidy' ); -} -BEGIN { - use_ok( 'HTML::Tidy::Message' ); -} -eval { - # For better test reporting - diag( "Testing HTML::Tidy $HTML::Tidy::VERSION, Perl $]; tidyp " . HTML::Tidy->tidyp_version() ); -} +use Test::More tests => 1; + +use HTML::Tidy; +use HTML::Tidy::Message; + +diag( "Testing HTML::Tidy $HTML::Tidy::VERSION, Perl $]; tidyp " . HTML::Tidy->tidyp_version() ); +pass( 'Modules loaded' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/cfg-for-parse.t new/HTML-Tidy-1.56/t/cfg-for-parse.t --- old/HTML-Tidy-1.54/t/cfg-for-parse.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/cfg-for-parse.t 2013-09-22 23:35:05.000000000 +0200 @@ -1,12 +1,11 @@ -#!perl -Tw +#!perl -T use warnings; use strict; + use Test::More tests => 3; -BEGIN { - use_ok( 'HTML::Tidy' ); -} +use HTML::Tidy; my $html = do { local $/; <DATA> }; @@ -19,10 +18,11 @@ chomp @expected_messages; shift @expected_messages; # First one's blank -my $tidy = new HTML::Tidy({config_file => 't/cfg-for-parse.cfg' }); +my $tidy = HTML::Tidy->new( { config_file => 't/cfg-for-parse.cfg' } ); isa_ok( $tidy, 'HTML::Tidy' ); -$tidy->parse( 'DATA', $html ); +my $rc = $tidy->parse( 'DATA', $html ); +ok( $rc, 'Parsed OK' ); my @returned = map { $_->as_string } $tidy->messages; s/[\r\n]+\z// for @returned; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/clean-crash.t new/HTML-Tidy-1.56/t/clean-crash.t --- old/HTML-Tidy-1.54/t/clean-crash.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/clean-crash.t 2013-09-22 22:57:22.000000000 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -Tw +#!/usr/bin/perl -T use warnings; use strict; @@ -8,17 +8,13 @@ #<URL: https://rt.cpan.org/Ticket/Display.html?id=7254 > #Here's a snippet of code to repro the bug, it produces an 'Illegal instruction' error -use Test::More tests=>3; +use Test::More tests => 2; -BEGIN { - use_ok( 'HTML::Tidy' ); -} - -use strict; +use HTML::Tidy; my $html = do { local $/; <DATA> }; -my $tidy = new HTML::Tidy; +my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( type => TIDY_INFO ); $tidy->clean( $html ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/extra-quote.t new/HTML-Tidy-1.56/t/extra-quote.t --- old/HTML-Tidy-1.54/t/extra-quote.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/extra-quote.t 2013-09-22 23:35:10.000000000 +0200 @@ -1,4 +1,4 @@ -#!perl -Tw +#!perl -T use warnings; use strict; @@ -8,7 +8,7 @@ use Test::More tests => 4; -BEGIN { use_ok( 'HTML::Tidy' ); } +use HTML::Tidy; my $html = do { local $/ = undef; <DATA> }; @@ -16,7 +16,8 @@ isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( text => qr/DOCTYPE/ ); -$tidy->parse( '-', $html ); +my $rc = $tidy->parse( '-', $html ); +ok( $rc, 'Parsed OK' ); my @expected = split /\n/, q{ - (4:1) Warning: <img> unexpected or duplicate quote mark diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/ignore-text.t new/HTML-Tidy-1.56/t/ignore-text.t --- old/HTML-Tidy-1.54/t/ignore-text.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/ignore-text.t 2013-09-23 00:20:45.000000000 +0200 @@ -1,12 +1,11 @@ -#!perl -Tw +#!perl -T use warnings; use strict; + use Test::More tests => 3; -BEGIN { - use_ok( 'HTML::Tidy' ); -} +use HTML::Tidy; my $html = do { local $/; <DATA> }; @@ -19,13 +18,14 @@ shift @expected_messages; # First one's blank IGNORE_BOGOTAG: { - my $tidy = new HTML::Tidy; + my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( text => qr/bogotag/ ); $tidy->ignore( text => [ qr/UNESCAPED/, qr/doctype/i ] ); # The qr/UNESCAPED/ should not ignore anything because there's no /i - $tidy->parse( 'DATA', $html ); + my $rc = $tidy->parse( 'DATA', $html ); + ok( $rc, 'Parsed OK' ); my @returned = map { $_->as_string } $tidy->messages; munge_returned( \@returned, 'DATA' ); @@ -36,10 +36,11 @@ sub munge_returned { # non-1 line numbers are not reliable across libtidies my $returned = shift; - my $start_line = shift || qq{-}; - for ( my $i = 0; $i < scalar @{$returned}; $i++ ) { - next if $returned->[$i] =~ m/$start_line \(\d+:1\)/; - $returned->[$i] =~ s/$start_line \((\d+):(\d+)\)/$start_line ($1:XX)/; + my $start_line = shift || '-'; + + for my $line ( @{$returned} ) { + next if $line =~ m/$start_line \(\d+:1\)/; + $line =~ s/$start_line \((\d+):(\d+)\)/$start_line ($1:XX)/; } } __DATA__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/ignore.t new/HTML-Tidy-1.56/t/ignore.t --- old/HTML-Tidy-1.54/t/ignore.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/ignore.t 2013-09-23 00:20:07.000000000 +0200 @@ -1,10 +1,11 @@ -#!perl -Tw +#!perl -T use strict; use warnings; -use Test::More tests => 7; -BEGIN { use_ok( 'HTML::Tidy' ); } +use Test::More tests => 9; + +use HTML::Tidy; my $html = do { local $/ = undef; <DATA> }; @@ -24,11 +25,12 @@ shift @expected_errors; # First one's blank WARNINGS_ONLY: { - my $tidy = new HTML::Tidy; + my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( type => TIDY_ERROR ); - $tidy->parse( '-', $html ); + my $rc = $tidy->parse( '-', $html ); + ok( $rc, 'Parsed OK' ); my @returned = map { $_->as_string } $tidy->messages; s/[\r\n]+\z// for @returned; @@ -37,11 +39,12 @@ } ERRORS_ONLY: { - my $tidy = new HTML::Tidy; + my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( type => TIDY_WARNING ); - $tidy->parse( '-', $html ); + my $rc = $tidy->parse( '-', $html ); + ok( $rc, 'Parsed OK' ); my @returned = map { $_->as_string } $tidy->messages; s/[\r\n]+\z// for @returned; @@ -49,20 +52,22 @@ } DIES_ON_ERROR: { - my $tidy = new HTML::Tidy; + my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); - eval { $tidy->ignore( blongo => TIDY_WARNING ) }; + my $rc = eval { $tidy->ignore( blongo => TIDY_WARNING ) }; + ok( !$rc, 'eval should fail' ); like( $@, qr/^Invalid ignore type.+blongo/, 'Throws an error' ); } sub munge_returned { # non-1 line numbers are not reliable across libtidies my $returned = shift; - my $start_line = shift || qq{-}; - for ( my $i = 0; $i < scalar @{$returned}; $i++ ) { - next if $returned->[$i] =~ m/$start_line \(\d+:1\)/; - $returned->[$i] =~ s/$start_line \((\d+):(\d+)\)/$start_line ($1:XX)/; + my $start_line = shift || '-'; + + for my $line ( @{$returned} ) { + next if $line =~ /$start_line \(\d+:1\)/; + $line =~ s/$start_line \((\d+):(\d+)\)/$start_line ($1:XX)/; } } __DATA__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/levels.t new/HTML-Tidy-1.56/t/levels.t --- old/HTML-Tidy-1.54/t/levels.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/levels.t 2013-09-23 00:21:27.000000000 +0200 @@ -1,16 +1,16 @@ -#!perl -Tw +#!perl -T use warnings; use strict; + use Test::More tests => 3; -BEGIN { - use_ok( 'HTML::Tidy' ); -} +use HTML::Tidy; -my $tidy = new HTML::Tidy; +my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); -$tidy->parse( '-', <DATA> ); +my $rc = $tidy->parse( '-', <DATA> ); +ok( $rc, 'Parsed OK' ); my @expected = split /\n/, q{ - (1:1) Warning: missing <!DOCTYPE> declaration @@ -30,11 +30,14 @@ sub munge_returned { # non-1 line numbers are not reliable across libtidies my $returned = shift; - my $start_line = shift || qq{-}; - for ( my $i = 0; $i < scalar @{$returned}; $i++ ) { - next if $returned->[$i] =~ m/$start_line \(\d+:1\)/; - $returned->[$i] =~ s/$start_line \((\d+):(\d+)\)/$start_line ($1:XX)/; + my $start_line = shift || '-'; + + for my $line ( @{$returned} ) { + next if $line =~ /$start_line \(\d+:1\)/; + $line =~ s/$start_line \((\d+):(\d+)\)/$start_line ($1:XX)/; } + + return; } __DATA__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/message.t new/HTML-Tidy-1.56/t/message.t --- old/HTML-Tidy-1.54/t/message.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/message.t 2013-09-23 00:24:21.000000000 +0200 @@ -1,12 +1,12 @@ -#!perl -Tw +#!perl -T use warnings; use strict; -use Test::More tests => 16; +use Test::More tests => 4; -BEGIN { use_ok( 'HTML::Tidy' ); } -BEGIN { use_ok( 'HTML::Tidy::Message' ); } +use HTML::Tidy; +use HTML::Tidy::Message; WITH_LINE_NUMBERS: { my $error = HTML::Tidy::Message->new( 'foo.pl', TIDY_ERROR, 2112, 5150, 'Blah blah' ); @@ -20,7 +20,7 @@ text => 'Blah blah', as_string => 'foo.pl (2112:5150) Error: Blah blah', ); - _match_up( $error, %expected ); + _match_up( $error, \%expected, 'With line numbers' ); } WITHOUT_LINE_NUMBERS: { @@ -35,15 +35,21 @@ text => 'Blah blah', as_string => 'bar.pl - Warning: Blah blah', ); - _match_up( $error, %expected ); + _match_up( $error, \%expected, 'Without line numbers' ); } sub _match_up { - my $error = shift; - my %expected = @_; - local $Test::Builder::Level = $Test::Builder::Level + 1; - for my $what ( sort keys %expected ) { - is( $error->$what, $expected{$what}, "$what matches" ); - } + + my $error = shift; + my $expected = shift; + my $msg = shift or die; + + return subtest "_matchup( $msg )" => sub { + plan tests => scalar keys %{$expected}; + + for my $what ( sort keys %{$expected} ) { + is( $error->$what, $expected->{$what}, "$what matches" ); + } + }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/opt-00.t new/HTML-Tidy-1.56/t/opt-00.t --- old/HTML-Tidy-1.54/t/opt-00.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/opt-00.t 2013-09-22 22:57:22.000000000 +0200 @@ -1,15 +1,13 @@ -#!perl -Tw +#!perl -T use warnings; use strict; -use Test::More; -BEGIN { - plan tests => 2; - use_ok( 'HTML::Tidy' ); -} +use Test::More tests => 1; -my $tidy = new HTML::Tidy({ +use HTML::Tidy; + +my $tidy = HTML::Tidy->new({ tidy_mark => 0, add_xml_decl => 1, output_xhtml => 1, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/perfect.t new/HTML-Tidy-1.56/t/perfect.t --- old/HTML-Tidy-1.54/t/perfect.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/perfect.t 2013-09-23 00:10:49.000000000 +0200 @@ -1,23 +1,25 @@ -#!perl -Tw +#!perl -T use warnings; use strict; + use Test::More tests => 3; -BEGIN { use_ok( 'HTML::Tidy' ); } +use HTML::Tidy; my $html = join '', <DATA>; # No errors at all. -my $tidy = new HTML::Tidy; +my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( type => TIDY_INFO ); -$tidy->parse( '-', $html ); +my $rc = $tidy->parse( '-', $html ); +ok( $rc, 'Parsed OK' ); my @returned = map { $_->as_string } $tidy->messages; -is( scalar @returned, 0, 'Should have no messages' ); +is_deeply( \@returned, [], 'Should have no messages' ); # User reported a segfault when there are no messages. By gum, he was # right. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/roundtrip.t new/HTML-Tidy-1.56/t/roundtrip.t --- old/HTML-Tidy-1.54/t/roundtrip.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/roundtrip.t 2013-09-23 00:10:23.000000000 +0200 @@ -1,12 +1,11 @@ -#!perl -Tw +#!perl -T use warnings; use strict; -use Test::More tests => 4; -BEGIN { - use_ok( 'HTML::Tidy' ); -} +use Test::More tests => 3; + +use HTML::Tidy; my $args = { newline => 'Lf' }; my $tidy = HTML::Tidy->new($args); @@ -24,8 +23,7 @@ $clean = $tidy->clean($clean); my @messages = $tidy->messages( $clean ); -is( scalar @messages, 0, q{The cleaned stuff shouldn't have any errors} ); -diag( 'But they do...', Dumper(\@messages) ) if @messages; +is_deeply( \@messages, [], q{The cleaned stuff shouldn't have any errors} ); $clean =~ s/"(HTML Tidy|tidyp).+w3\.org"/"Tidy"/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/simple.t new/HTML-Tidy-1.56/t/simple.t --- old/HTML-Tidy-1.54/t/simple.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/simple.t 2013-09-23 00:10:27.000000000 +0200 @@ -1,13 +1,11 @@ -#!perl -w +#!perl -T use warnings; use strict; use Test::More tests => 4; -BEGIN { - use_ok( 'HTML::Tidy' ); -} +use HTML::Tidy; my $html = join '', <DATA>; @@ -15,13 +13,14 @@ isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( type => TIDY_INFO ); -$tidy->parse( '-', $html ); +my $rc = $tidy->parse( '-', $html ); +ok( $rc, 'Parsed OK' ); my @messages = $tidy->messages; is( scalar @messages, 5, 'Right number of initial messages' ); $tidy->clear_messages; -is( scalar $tidy->messages, 0, 'Cleared the messages' ); +is_deeply( [$tidy->messages], [], 'Cleared the messages' ); __DATA__ <html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/too-many-titles.t new/HTML-Tidy-1.56/t/too-many-titles.t --- old/HTML-Tidy-1.54/t/too-many-titles.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/too-many-titles.t 2013-09-22 23:35:39.000000000 +0200 @@ -1,12 +1,11 @@ -#!perl -Tw +#!perl -T use warnings; use strict; + use Test::More tests => 3; -BEGIN { - use_ok( 'HTML::Tidy' ); -} +use HTML::Tidy; my $html = join '', <DATA>; @@ -17,10 +16,11 @@ chomp @expected; shift @expected; # First one's blank -my $tidy = new HTML::Tidy; +my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( type => TIDY_INFO ); -$tidy->parse( '-', $html ); +my $rc = $tidy->parse( '-', $html ); +ok( $rc, 'Parsed OK' ); my @returned = map { $_->as_string } $tidy->messages; s/[\r\n]+\z// for @returned; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/unicode-nbsp.t new/HTML-Tidy-1.56/t/unicode-nbsp.t --- old/HTML-Tidy-1.54/t/unicode-nbsp.t 1970-01-01 01:00:00.000000000 +0100 +++ new/HTML-Tidy-1.56/t/unicode-nbsp.t 2013-09-23 00:12:06.000000000 +0200 @@ -0,0 +1,20 @@ +#!perl -T + +use warnings; +use strict; + +use Test::More tests => 2; + +use HTML::Tidy; + +use Encode; + +my $bytes_string = "\x{c2}\x{a0}"; #UTF8 nbsp +my $perl_chars = Encode::decode('utf8',$bytes_string); #perl chars of utf8 byte string + +my $expected_after_tidy = " \n"; # HTML::Tidy adds a \n and should convert the nbsp to an HTML entity + +my $tidy = HTML::Tidy->new({ show_body_only => 1 }); + +is( $tidy->clean( $perl_chars ), $expected_after_tidy, 'Perl chars OK' ); +is( $tidy->clean( $bytes_string ), $expected_after_tidy, 'Byte string OK' ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/unicode.t new/HTML-Tidy-1.56/t/unicode.t --- old/HTML-Tidy-1.54/t/unicode.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/unicode.t 2013-09-23 00:08:59.000000000 +0200 @@ -1,30 +1,29 @@ -#!perl -Tw -# unicode.t +#!perl -T # Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org> use warnings; use strict; -use Test::More tests => 7; -BEGIN { - use_ok( 'HTML::Tidy' ); -} +use Test::More tests => 9; + +use HTML::Tidy; +use Encode (); +use Carp; my $args = { newline => 'Lf' }; my $tidy = HTML::Tidy->new($args); $tidy->ignore( type => TIDY_INFO ); -# suck in the reference HTML document -open( my $html_in, '<:utf8', 't/unicode.html' ) or - die "Can't read unicode.html: $!"; +# Suck in the reference HTML document. +open( my $html_in, '<:utf8', 't/unicode.html' ) or Carp::croak( "Can't read unicode.html: $!" ); my $html = do { local $/; <$html_in> }; close $html_in; -# suck in the correct, cleaned doc (from DATA) +# Suck in the correct, cleaned doc (from DATA) binmode DATA, ':utf8'; my $reference = do {local $/; <DATA>}; -# make sure both are unicode characters (not utf-x octets) +# Make sure both are unicode characters (not utf-x octets). ok(utf8::is_utf8($html), 'html is utf8'); ok(utf8::is_utf8($reference), 'reference is utf8'); @@ -36,12 +35,24 @@ is($clean, $reference, q{Cleanup didn't break anything}); my @messages = $tidy->messages; -is( scalar @messages, 0, q{There shouldn't have been any errors}); +is_deeply( \@messages, [], q{There still shouldn't be any errors} ); $tidy = HTML::Tidy->new($args); -$tidy->parse( '', $html ); +isa_ok( $tidy, 'HTML::Tidy' ); +my $rc = $tidy->parse( '', $html ); +ok( $rc, 'Parsed OK' ); @messages = $tidy->messages; -is( scalar @messages, 0, q{There still shouldn't be any errors}); +is_deeply( \@messages, [], q{There still shouldn't be any errors} ); + +subtest 'Try send bytes to clean method.' => sub { + my $html = Encode::encode('utf8',$html); + ok(!utf8::is_utf8($html), 'html is row bytes'); + my $clean = $tidy->clean( $html ); + ok(utf8::is_utf8($clean), 'but cleaned output is string'); + $clean =~ s/"HTML Tidy.+w3\.org"/"Tidy"/; + $clean =~ s/"(HTML Tidy|tidyp).+w3\.org"/"Tidy"/; + is($clean, $reference, q{Cleanup didn't break anything}); +}; __DATA__ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/venus.t new/HTML-Tidy-1.56/t/venus.t --- old/HTML-Tidy-1.54/t/venus.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/venus.t 2013-09-22 22:57:22.000000000 +0200 @@ -1,13 +1,11 @@ -#!perl -Tw +#!perl -T use warnings; use strict; -use Test::More; -BEGIN { - plan tests => 3; - use_ok( 'HTML::Tidy' ); -} +use Test::More tests => 2; + +use HTML::Tidy; my $filename = 't/venus.html'; open( my $fh, '<', $filename ) or die "Can't open $filename: $!\n"; @@ -15,7 +13,7 @@ close $fh; my $cfg = 't/venus.cfg'; -my $tidy = new HTML::Tidy( {config_file => $cfg} ); +my $tidy = HTML::Tidy->new( {config_file => $cfg} ); isa_ok( $tidy, 'HTML::Tidy' ); my $cooked = $tidy->clean( $raw ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/version.t new/HTML-Tidy-1.56/t/version.t --- old/HTML-Tidy-1.54/t/version.t 2010-09-17 05:21:10.000000000 +0200 +++ new/HTML-Tidy-1.56/t/version.t 2013-09-22 22:57:22.000000000 +0200 @@ -1,16 +1,13 @@ -#!perl -Tw +#!perl -T use warnings; use strict; -use Test::More; -BEGIN { - plan tests => 5; - use_ok( 'HTML::Tidy' ); -} +use Test::More tests => 4; + +use HTML::Tidy; for my $version_string (HTML::Tidy->tidyp_version, HTML::Tidy->libtidyp_version) { like( $version_string, qr/^\d\.\d{2,}$/, 'Valid version string' ); cmp_ok( $version_string, '>=', '0.90', 'Version is greater than 0.90, which is the one I maintain' ); } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Tidy-1.54/t/wordwrap.t new/HTML-Tidy-1.56/t/wordwrap.t --- old/HTML-Tidy-1.54/t/wordwrap.t 2010-09-17 05:13:22.000000000 +0200 +++ new/HTML-Tidy-1.56/t/wordwrap.t 2013-09-22 22:57:22.000000000 +0200 @@ -1,12 +1,11 @@ -#!perl -Tw +#!perl -T + use warnings; use strict; -use Test::More; -BEGIN { - plan tests => 2; - use_ok( 'HTML::Tidy' ); -} +use Test::More tests => 1; + +use HTML::Tidy; my $input=q{Here's some <B>ed and <BR/>eakfest MarkUp}; @@ -30,7 +29,7 @@ my @expected = split(/\n/, $expected); my $cfg = 't/wordwrap.cfg'; -my $tidy = new HTML::Tidy( {config_file => $cfg} ); +my $tidy = HTML::Tidy->new( {config_file => $cfg} ); my $result = $tidy->clean( $input ); my @result = split(/\n/, $result); -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de