r60052 - in /branches/upstream/libcss-tiny-perl/current: Changes MANIFEST META.yml Makefile.PL README lib/CSS/Tiny.pm t/02_main.t t/98_pod.t t/99_pmv.t xt/ xt/meta.t xt/pmv.t xt/pod.t
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Mon Jul 5 01:31:10 UTC 2010
Author: ansgar-guest
Date: Mon Jul 5 01:30:36 2010
New Revision: 60052
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60052
Log:
[svn-upgrade] new version libcss-tiny-perl (1.17)
Added:
branches/upstream/libcss-tiny-perl/current/xt/
branches/upstream/libcss-tiny-perl/current/xt/meta.t
branches/upstream/libcss-tiny-perl/current/xt/pmv.t
branches/upstream/libcss-tiny-perl/current/xt/pod.t
Removed:
branches/upstream/libcss-tiny-perl/current/t/98_pod.t
branches/upstream/libcss-tiny-perl/current/t/99_pmv.t
Modified:
branches/upstream/libcss-tiny-perl/current/Changes
branches/upstream/libcss-tiny-perl/current/MANIFEST
branches/upstream/libcss-tiny-perl/current/META.yml
branches/upstream/libcss-tiny-perl/current/Makefile.PL
branches/upstream/libcss-tiny-perl/current/README
branches/upstream/libcss-tiny-perl/current/lib/CSS/Tiny.pm
branches/upstream/libcss-tiny-perl/current/t/02_main.t
Modified: branches/upstream/libcss-tiny-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/Changes?rev=60052&op=diff
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/Changes (original)
+++ branches/upstream/libcss-tiny-perl/current/Changes Mon Jul 5 01:30:36 2010
@@ -1,4 +1,15 @@
-Revision history for Perl extension CSS::Tiny
+Revision history for Perl extension CSS-Tiny
+
+1.17 Sun 4 Jul 2010
+ - Removed the use of Module::Install
+ - Allow read-string to be rerun again on an existing object,
+ and thus also thus on tied objects (MPETERS)
+ - Moved POD after __END__ to reduce number of disk reads when parsing.
+ - Added support for running xt tests
+
+1.16 Fri 4 Jul 2008
+ - Upgrading to Module::Install 0.76
+ - Localising $@ during evals
1.15 Thu 1 Nov 2007
- Moving from Module::Install to the tinier EU:MM
Modified: branches/upstream/libcss-tiny-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/MANIFEST?rev=60052&op=diff
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/MANIFEST (original)
+++ branches/upstream/libcss-tiny-perl/current/MANIFEST Mon Jul 5 01:30:36 2010
@@ -7,7 +7,8 @@
t/01_compile.t
t/02_main.t
t/03_inline_clone.t
-t/98_pod.t
-t/99_pmv.t
test.css
+xt/meta.t
+xt/pmv.t
+xt/pod.t
META.yml Module meta-data (added by MakeMaker)
Modified: branches/upstream/libcss-tiny-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/META.yml?rev=60052&op=diff
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/META.yml (original)
+++ branches/upstream/libcss-tiny-perl/current/META.yml Mon Jul 5 01:30:36 2010
@@ -1,14 +1,24 @@
--- #YAML:1.0
-name: CSS-Tiny
-version: 1.15
-abstract: Read/Write .css files with as little code as possible
-license: perl
-generated_by: ExtUtils::MakeMaker version 6.32
-distribution_type: module
-requires:
- Test::More: 0.47
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
+name: CSS-Tiny
+version: 1.17
+abstract: Read/Write .css files with as little code as possible
author:
- Adam Kennedy <adamk at cpan.org>
+license: perl
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ Test::More: 0.47
+requires:
+ perl: 5.004
+resources:
+ repository: http://svn.ali.as/cpan/trunk/CSS-Tiny
+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
Modified: branches/upstream/libcss-tiny-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/Makefile.PL?rev=60052&op=diff
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/Makefile.PL (original)
+++ branches/upstream/libcss-tiny-perl/current/Makefile.PL Mon Jul 5 01:30:36 2010
@@ -1,22 +1,53 @@
use strict;
use vars qw{$VERSION};
BEGIN {
- require 5.003_96;
- $VERSION = '1.15';
+ require 5.004;
+ $VERSION = '1.17';
}
use ExtUtils::MakeMaker;
WriteMakefile(
+ MIN_PERL_VERSION => '5.004',
+ META_MERGE => {
+ resources => {
+ repository => 'http://svn.ali.as/cpan/trunk/CSS-Tiny',
+ },
+ },
NAME => 'CSS::Tiny',
ABSTRACT => 'Read/Write .css files with as little code as possible',
VERSION => $VERSION,
PREREQ_PM => {
- 'Test::More' => '0.47',
},
- ($] >= 5.005 ? (
- AUTHOR => 'Adam Kennedy <adamk at cpan.org>',
- ) : ()),
- ($ExtUtils::MakeMaker::VERSION ge '6.30_00' ? (
- LICENSE => 'perl',
- ) : ()),
+ BUILD_REQUIRES => {
+ # Skip on Windows to avoid breaking ActivePerl PPMs
+ # 0.47 means 5.6.2 or newer, which everyone on Win32 has.
+ ($^O eq 'MSWin32' ? () : ('Test::More' => '0.47')),
+ },
+ AUTHOR => 'Adam Kennedy <adamk at cpan.org>',
+ LICENSE => 'perl',
+ (-d 'xt' and $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING}) ? (
+ test => {
+ TESTS => 't/*.t xt/*.t',
+ },
+ ) : (),
);
+
+sub WriteMakefile { #Written by Alexandr Ciornii, version 0.21. Added by eumm-upgrade.
+ my %params=@_;
+ my $eumm_version=$ExtUtils::MakeMaker::VERSION;
+ $eumm_version=eval $eumm_version;
+ if ( $params{BUILD_REQUIRES} and $eumm_version < 6.5503 ) {
+ #EUMM 6.5502 has problems with BUILD_REQUIRES
+ $params{PREREQ_PM} = {
+ %{$params{PREREQ_PM} || {}},
+ %{$params{BUILD_REQUIRES}}
+ };
+ delete $params{BUILD_REQUIRES};
+ }
+ delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48;
+ delete $params{META_MERGE} if $eumm_version < 6.46;
+ delete $params{LICENSE} if $eumm_version < 6.31;
+ delete $params{AUTHOR} if $] < 5.005;
+
+ ExtUtils::MakeMaker::WriteMakefile(%params);
+}
Modified: branches/upstream/libcss-tiny-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/README?rev=60052&op=diff
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/README (original)
+++ branches/upstream/libcss-tiny-perl/current/README Mon Jul 5 01:30:36 2010
@@ -6,31 +6,31 @@
H1 { color: blue }
H2 { color: red; font-family: Arial }
.this, .that { color: yellow }
-
- # In your program
+
+ # In your program
use CSS::Tiny;
-
- # Create a CSS stylesheet
+
+ # Create a CSS stylesheet
my $CSS = CSS::Tiny->new();
-
- # Open a CSS stylesheet
+
+ # Open a CSS stylesheet
$CSS = CSS::Tiny->read( 'style.css' );
-
- # Reading properties
+
+ # Reading properties
my $header_color = $CSS->{H1}->{color};
my $header2_hashref = $CSS->{H2};
my $this_color = $CSS->{'.this'}->{color};
my $that_color = $CSS->{'.that'}->{color};
-
- # Changing styles and properties
+
+ # Changing styles and properties
$CSS->{'.newstyle'} = { color => '#FFFFFF' }; # Add a style
$CSS->{H1}->{color} = 'black'; # Change a property
delete $CSS->{H2}; # Delete a style
-
- # Save a CSS stylesheet
+
+ # Save a CSS stylesheet
$CSS->write( 'style.css' );
-
- # Get the CSS as a <style>...</style> tag
+
+ # Get the CSS as a <style>...</style> tag
$CSS->html;
DESCRIPTION
@@ -112,12 +112,12 @@
The "clone" method creates an identical copy of an existing "CSS::Tiny"
object.
+ write_string
+ Generates the stylesheet for the object and returns it as a string.
+
write
The "write $filename" generates the stylesheet for the properties, and
writes it to disk. Returns true on success. Returns "undef" on error.
-
- write_string
- Generates the stylesheet for the object and returns it as a string.
html
The "html" method generates the CSS, but wrapped in a "style" HTML tag,
@@ -146,7 +146,7 @@
CSS, <http://www.w3.org/TR/REC-CSS1>, Config::Tiny, <http://ali.as/>
COPYRIGHT
- Copyright 2002 - 2007 Adam Kennedy.
+ Copyright 2002 - 2010 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Modified: branches/upstream/libcss-tiny-perl/current/lib/CSS/Tiny.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/lib/CSS/Tiny.pm?rev=60052&op=diff
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/lib/CSS/Tiny.pm (original)
+++ branches/upstream/libcss-tiny-perl/current/lib/CSS/Tiny.pm Mon Jul 5 01:30:36 2010
@@ -1,142 +1,18 @@
package CSS::Tiny;
-=pod
-
-=head1 NAME
-
-CSS::Tiny - Read/Write .css files with as little code as possible
-
-=head1 SYNOPSIS
-
- # In your .css file
- H1 { color: blue }
- H2 { color: red; font-family: Arial }
- .this, .that { color: yellow }
-
- # In your program
- use CSS::Tiny;
-
- # Create a CSS stylesheet
- my $CSS = CSS::Tiny->new();
-
- # Open a CSS stylesheet
- $CSS = CSS::Tiny->read( 'style.css' );
-
- # Reading properties
- my $header_color = $CSS->{H1}->{color};
- my $header2_hashref = $CSS->{H2};
- my $this_color = $CSS->{'.this'}->{color};
- my $that_color = $CSS->{'.that'}->{color};
-
- # Changing styles and properties
- $CSS->{'.newstyle'} = { color => '#FFFFFF' }; # Add a style
- $CSS->{H1}->{color} = 'black'; # Change a property
- delete $CSS->{H2}; # Delete a style
-
- # Save a CSS stylesheet
- $CSS->write( 'style.css' );
-
- # Get the CSS as a <style>...</style> tag
- $CSS->html;
-
-=head1 DESCRIPTION
-
-C<CSS::Tiny> is a perl class to read and write .css stylesheets with as
-little code as possible, reducing load time and memory overhead. CSS.pm
-requires about 2.6 meg or ram to load, which is a large amount of
-overhead if you only want to do trivial things.
-Memory usage is normally scoffed at in Perl, but in my opinion should be
-at least kept in mind.
-
-This module is primarily for reading and writing simple files, and anything
-we write shouldn't need to have documentation/comments. If you need
-something with more power, move up to CSS.pm. With the increasing complexity
-of CSS, this is becoming more common, but many situations can still live
-with simple CSS files.
-
-=head2 CSS Feature Support
-
-C<CSS::Tiny> supports grouped styles of the form
-C<this, that { color: blue }> correctly when reading, ungrouping them into
-the hash structure. However, it will not restore the grouping should you
-write the file back out. In this case, an entry in the original file of
-the form
-
- H1, H2 { color: blue }
-
-would become
-
- H1 { color: blue }
- H2 { color: blue }
-
-C<CSS::Tiny> handles nested styles of the form C<P EM { color: red }>
-in reads and writes correctly, making the property available in the
-form
-
- $CSS->{'P EM'}->{color}
-
-C<CSS::Tiny> ignores comments of the form C</* comment */> on read
-correctly, however these comments will not be written back out to the
-file.
-
-=head1 CSS FILE SYNTAX
-
-Files are written in a relatively human-orientated form, as follows:
-
- H1 {
- color: blue;
- }
- .this {
- color: red;
- font-size: 10px;
- }
- P EM {
- color: yellow;
- }
-
-When reading and writing, all property descriptors, for example C<color>
-and C<font-size> in the example above, are converted to lower case. As an
-example, take the following CSS.
-
- P {
- Font-Family: Verdana;
- }
-
-To get the value C<'Verdana'> from the object C<$CSS>, you should
-reference the key C<$CSS-E<gt>{P}-E<gt>{font-family}>.
-
-=head1 METHODS
-
-=cut
+# See POD at end for docs
use strict;
BEGIN {
require 5.004;
- $CSS::Tiny::VERSION = '1.15';
+ $CSS::Tiny::VERSION = '1.17';
$CSS::Tiny::errstr = '';
}
-=pod
-
-=head2 new
-
-The constructor C<new> creates and returns an empty C<CSS::Tiny> object.
-
-=cut
-
+# Create an empty object
sub new { bless {}, shift }
-=pod
-
-=head2 read $filename
-
-The C<read> constructor reads a CSS stylesheet, and returns a new
-C<CSS::Tiny> object containing the properties in the file.
-
-Returns the object on success, or C<undef> on error.
-
-=cut
-
+# Create an object from a file
sub read {
my $class = shift;
@@ -155,18 +31,9 @@
$class->read_string( $contents )
}
-=pod
-
-=head2 read_string $string
-
-The C<read_string> constructor reads a CSS stylesheet from a string.
-
-Returns the object on success, or C<undef> on error.
-
-=cut
-
+# Create an object from a string
sub read_string {
- my $self = bless {}, shift;
+ my $self = ref $_[0] ? shift : bless {}, shift;
# Flatten whitespace and remove /* comment */ style comments
my $string = shift;
@@ -197,16 +64,8 @@
$self
}
-=pod
-
-=head2 clone
-
-The C<clone> method creates an identical copy of an existing C<CSS::Tiny>
-object.
-
-=cut
-
-BEGIN { eval "use Clone 'clone';"; eval <<'END_PERL' if $@; }
+# Copy an object, using Clone.pm if available
+BEGIN { local $@; eval "use Clone 'clone';"; eval <<'END_PERL' if $@; }
sub clone {
my $self = shift;
my $copy = ref($self)->new;
@@ -221,15 +80,7 @@
}
END_PERL
-=pod
-
-=head2 write
-
-The C<write $filename> generates the stylesheet for the properties, and
-writes it to disk. Returns true on success. Returns C<undef> on error.
-
-=cut
-
+# Save an object to a file
sub write {
my $self = shift;
my $file = shift or return $self->_error( 'No file name provided' );
@@ -238,18 +89,9 @@
open( CSS, '>'. $file ) or return $self->_error( "Failed to open file '$file' for writing: $!" );
print CSS $self->write_string;
close( CSS );
-
- 1
-}
-
-=pod
-
-=head2 write_string
-
-Generates the stylesheet for the object and returns it as a string.
-
-=cut
-
+}
+
+# Save an object to a string
sub write_string {
my $self = shift;
@@ -266,53 +108,182 @@
$contents .= "}\n";
}
- $contents
-}
+ return $contents;
+}
+
+# Generate a HTML fragment for the CSS
+sub html {
+ my $css = $_[0]->write_string or return '';
+ return "<style type=\"text/css\">\n<!--\n${css}-->\n</style>";
+}
+
+# Generate an xhtml fragment for the CSS
+sub xhtml {
+ my $css = $_[0]->write_string or return '';
+ return "<style type=\"text/css\">\n/* <![CDATA[ */\n${css}/* ]]> */\n</style>";
+}
+
+# Error handling
+sub errstr { $CSS::Tiny::errstr }
+sub _error { $CSS::Tiny::errstr = $_[1]; undef }
+
+1;
+
+__END__
=pod
+
+=head1 NAME
+
+CSS::Tiny - Read/Write .css files with as little code as possible
+
+=head1 SYNOPSIS
+
+ # In your .css file
+ H1 { color: blue }
+ H2 { color: red; font-family: Arial }
+ .this, .that { color: yellow }
+
+ # In your program
+ use CSS::Tiny;
+
+ # Create a CSS stylesheet
+ my $CSS = CSS::Tiny->new();
+
+ # Open a CSS stylesheet
+ $CSS = CSS::Tiny->read( 'style.css' );
+
+ # Reading properties
+ my $header_color = $CSS->{H1}->{color};
+ my $header2_hashref = $CSS->{H2};
+ my $this_color = $CSS->{'.this'}->{color};
+ my $that_color = $CSS->{'.that'}->{color};
+
+ # Changing styles and properties
+ $CSS->{'.newstyle'} = { color => '#FFFFFF' }; # Add a style
+ $CSS->{H1}->{color} = 'black'; # Change a property
+ delete $CSS->{H2}; # Delete a style
+
+ # Save a CSS stylesheet
+ $CSS->write( 'style.css' );
+
+ # Get the CSS as a <style>...</style> tag
+ $CSS->html;
+
+=head1 DESCRIPTION
+
+C<CSS::Tiny> is a perl class to read and write .css stylesheets with as
+little code as possible, reducing load time and memory overhead. CSS.pm
+requires about 2.6 meg or ram to load, which is a large amount of
+overhead if you only want to do trivial things.
+Memory usage is normally scoffed at in Perl, but in my opinion should be
+at least kept in mind.
+
+This module is primarily for reading and writing simple files, and anything
+we write shouldn't need to have documentation/comments. If you need
+something with more power, move up to CSS.pm. With the increasing complexity
+of CSS, this is becoming more common, but many situations can still live
+with simple CSS files.
+
+=head2 CSS Feature Support
+
+C<CSS::Tiny> supports grouped styles of the form
+C<this, that { color: blue }> correctly when reading, ungrouping them into
+the hash structure. However, it will not restore the grouping should you
+write the file back out. In this case, an entry in the original file of
+the form
+
+ H1, H2 { color: blue }
+
+would become
+
+ H1 { color: blue }
+ H2 { color: blue }
+
+C<CSS::Tiny> handles nested styles of the form C<P EM { color: red }>
+in reads and writes correctly, making the property available in the
+form
+
+ $CSS->{'P EM'}->{color}
+
+C<CSS::Tiny> ignores comments of the form C</* comment */> on read
+correctly, however these comments will not be written back out to the
+file.
+
+=head1 CSS FILE SYNTAX
+
+Files are written in a relatively human-orientated form, as follows:
+
+ H1 {
+ color: blue;
+ }
+ .this {
+ color: red;
+ font-size: 10px;
+ }
+ P EM {
+ color: yellow;
+ }
+
+When reading and writing, all property descriptors, for example C<color>
+and C<font-size> in the example above, are converted to lower case. As an
+example, take the following CSS.
+
+ P {
+ Font-Family: Verdana;
+ }
+
+To get the value C<'Verdana'> from the object C<$CSS>, you should
+reference the key C<$CSS-E<gt>{P}-E<gt>{font-family}>.
+
+=head1 METHODS
+
+=head2 new
+
+The constructor C<new> creates and returns an empty C<CSS::Tiny> object.
+
+=head2 read $filename
+
+The C<read> constructor reads a CSS stylesheet, and returns a new
+C<CSS::Tiny> object containing the properties in the file.
+
+Returns the object on success, or C<undef> on error.
+
+=head2 read_string $string
+
+The C<read_string> constructor reads a CSS stylesheet from a string.
+
+Returns the object on success, or C<undef> on error.
+
+=head2 clone
+
+The C<clone> method creates an identical copy of an existing C<CSS::Tiny>
+object.
+
+=head2 write_string
+
+Generates the stylesheet for the object and returns it as a string.
+
+=head2 write
+
+The C<write $filename> generates the stylesheet for the properties, and
+writes it to disk. Returns true on success. Returns C<undef> on error.
=head2 html
The C<html> method generates the CSS, but wrapped in a C<style> HTML tag,
so that it can be dropped directly onto a HTML page.
-=cut
-
-sub html {
- my $css = $_[0]->write_string or return '';
- "<style type=\"text/css\">\n<!--\n${css}-->\n</style>";
-}
-
-=pod
-
=head2 xhtml
The C<html> method generates the CSS, but wrapped in a C<style> XHTML tag,
so that it can be dropped directly onto an XHTML page.
-=cut
-
-sub xhtml {
- my $css = $_[0]->write_string or return '';
- "<style type=\"text/css\">\n/* <![CDATA[ */\n${css}/* ]]> */\n</style>";
-}
-
-=pod
-
=head2 errstr
When an error occurs, you can retrieve the error message either from the
C<$CSS::Tiny::errstr> variable, or using the C<errstr> method.
-=cut
-
-sub errstr { $CSS::Tiny::errstr }
-sub _error { $CSS::Tiny::errstr = $_[1]; undef }
-
-1;
-
-=pod
-
=head1 SUPPORT
Bugs should be reported via the CPAN bug tracker at
@@ -331,7 +302,7 @@
=head1 COPYRIGHT
-Copyright 2002 - 2007 Adam Kennedy.
+Copyright 2002 - 2010 Adam Kennedy.
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
Modified: branches/upstream/libcss-tiny-perl/current/t/02_main.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/t/02_main.t?rev=60052&op=diff
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/t/02_main.t (original)
+++ branches/upstream/libcss-tiny-perl/current/t/02_main.t Mon Jul 5 01:30:36 2010
@@ -8,7 +8,7 @@
$^W = 1;
}
-use Test::More tests => 22;
+use Test::More tests => 23;
use CSS::Tiny;
@@ -16,13 +16,13 @@
# Test trivial creation
-my $Trivial = CSS::Tiny->new();
-isa_ok( $Trivial, 'CSS::Tiny' );
-is( scalar(keys %$Trivial), 0, '->new returns an empty object' );
+my $trivial = CSS::Tiny->new;
+isa_ok( $trivial, 'CSS::Tiny' );
+is( scalar(keys %$trivial), 0, '->new returns an empty object' );
# Try to read in a config
-my $Config = CSS::Tiny->read( 'test.css' );
-isa_ok( $Config, 'CSS::Tiny' );
+my $css = CSS::Tiny->read( 'test.css' );
+isa_ok( $css, 'CSS::Tiny' );
# Check the structure of the config
my $expected = {
@@ -33,21 +33,21 @@
'C D' => { foo => 'bar' },
};
bless $expected, 'CSS::Tiny';
-is_deeply( $Config, $expected, '->read returns expected structure' );
+is_deeply( $css, $expected, '->read returns expected structure' );
# Test clone
-my $copy = $Config->clone;
+my $copy = $css->clone;
isa_ok( $copy, 'CSS::Tiny' );
-is_deeply( $copy, $Config, '->clone works as expected' );
+is_deeply( $copy, $css, '->clone works as expected' );
# Add some stuff to the trivial stylesheet and check write_string() for it
-$Trivial->{H1} = { color => 'blue' };
-$Trivial->{'.this'} = {
+$trivial->{H1} = { color => 'blue' };
+$trivial->{'.this'} = {
color => '#FFFFFF',
'font-family' => 'Arial, "Courier New"',
'font-variant' => 'small-caps',
};
-$Trivial->{'P EM'} = { color => 'red' };
+$trivial->{'P EM'} = { color => 'red' };
my $string = <<END;
P EM {
@@ -63,16 +63,20 @@
}
END
-my $Read = CSS::Tiny->read_string( $string );
-ok( $Read, '>read_string() returns true' );
-is_deeply( $Read, $Trivial, '->read_string() returns expected' );
+my $read = CSS::Tiny->read_string( $string );
+ok( $read, '>read_string() returns true' );
+is_deeply( $read, $trivial, '->read_string() returns expected' );
-my $generated = $Trivial->write_string();
+my $read2 = CSS::Tiny->new;
+$read2->read_string($string);
+is_deeply( $read2, $trivial, 'object->read_string() returns expected' );
+
+my $generated = $trivial->write_string();
ok( length $generated, '->write_string returns something' );
ok( $generated eq $string, '->write_string returns the correct file contents' );
# Try to write a file
-my $rv = $Trivial->write( 'test2.css' );
+my $rv = $trivial->write( 'test2.css' );
ok( $rv, '->write returned true' );
ok( -e 'test2.css', '->write actually created a file' );
@@ -82,11 +86,11 @@
}
# Try to read the config back in
-$Read = CSS::Tiny->read( 'test2.css' );
-isa_ok( $Read, 'CSS::Tiny' );
+$read = CSS::Tiny->read( 'test2.css' );
+isa_ok( $read, 'CSS::Tiny' );
# Check the structure of what we read back in
-is_deeply( $Trivial, $Read, 'We get back what we wrote out' );
+is_deeply( $trivial, $read, 'We get back what we wrote out' );
@@ -112,12 +116,12 @@
#####################################################################
# Check the HTML generation
-my $HTML = CSS::Tiny->new();
-isa_ok( $HTML, 'CSS::Tiny' );
-is( $HTML->html, '', '->html returns empty string for empty stylesheet' );
+my $html = CSS::Tiny->new();
+isa_ok( $html, 'CSS::Tiny' );
+is( $html->html, '', '->html returns empty string for empty stylesheet' );
-$HTML->{'.foo'}->{bar} = 1;
-is( $HTML->html . "\n", <<'END_HTML', '->html returns correct looking HTML' );
+$html->{'.foo'}->{bar} = 1;
+is( $html->html . "\n", <<'END_HTML', '->html returns correct looking HTML' );
<style type="text/css">
<!--
.foo {
@@ -134,12 +138,12 @@
#####################################################################
# Check the XHTML generation
-my $XHTML = CSS::Tiny->new;
-isa_ok( $XHTML, 'CSS::Tiny' );
-is( $XHTML->xhtml, '', '->xhtml returns empty string for empty stylesheet' );
+my $xhtml = CSS::Tiny->new;
+isa_ok( $xhtml, 'CSS::Tiny' );
+is( $xhtml->xhtml, '', '->xhtml returns empty string for empty stylesheet' );
-$XHTML->{'.foo'}->{bar} = 1;
-is( $HTML->xhtml . "\n", <<'END_XHTML', '->xhtml returns correct looking HTML' );
+$xhtml->{'.foo'}->{bar} = 1;
+is( $html->xhtml . "\n", <<'END_XHTML', '->xhtml returns correct looking HTML' );
<style type="text/css">
/* <![CDATA[ */
.foo {
@@ -148,5 +152,3 @@
/* ]]> */
</style>
END_XHTML
-
-1;
Added: branches/upstream/libcss-tiny-perl/current/xt/meta.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/xt/meta.t?rev=60052&op=file
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/xt/meta.t (added)
+++ branches/upstream/libcss-tiny-perl/current/xt/meta.t Mon Jul 5 01:30:36 2010
@@ -1,0 +1,27 @@
+#!/usr/bin/perl
+
+# Test that our META.yml file matches the current specification.
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+my $MODULE = 'Test::CPAN::Meta 0.17';
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+ plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing module
+eval "use $MODULE";
+if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" )
+ : plan( skip_all => "$MODULE not available for testing" );
+}
+
+meta_yaml_ok();
Added: branches/upstream/libcss-tiny-perl/current/xt/pmv.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/xt/pmv.t?rev=60052&op=file
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/xt/pmv.t (added)
+++ branches/upstream/libcss-tiny-perl/current/xt/pmv.t Mon Jul 5 01:30:36 2010
@@ -1,0 +1,32 @@
+#!/usr/bin/perl
+
+# Test that our declared minimum Perl version matches our syntax
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+my @MODULES = (
+ 'Perl::MinimumVersion 1.25',
+ 'Test::MinimumVersion 0.101080',
+);
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+ plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+ eval "use $MODULE";
+ if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" )
+ : plan( skip_all => "$MODULE not available for testing" );
+ }
+}
+
+all_minimum_version_from_metayml_ok();
Added: branches/upstream/libcss-tiny-perl/current/xt/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcss-tiny-perl/current/xt/pod.t?rev=60052&op=file
==============================================================================
--- branches/upstream/libcss-tiny-perl/current/xt/pod.t (added)
+++ branches/upstream/libcss-tiny-perl/current/xt/pod.t Mon Jul 5 01:30:36 2010
@@ -1,0 +1,32 @@
+#!/usr/bin/perl
+
+# Test that the syntax of our POD documentation is valid
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+my @MODULES = (
+ 'Pod::Simple 3.14',
+ 'Test::Pod 1.44',
+);
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+ plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+ eval "use $MODULE";
+ if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" )
+ : plan( skip_all => "$MODULE not available for testing" );
+ }
+}
+
+all_pod_files_ok();
More information about the Pkg-perl-cvs-commits
mailing list