[Bps-public-commit] CSS-Squish branch, master, updated. 1d5cd2a7c82d65320881345177e03da5b9363cc8
Ruslan Zakirov
ruz at bestpractical.com
Tue Dec 8 10:55:58 EST 2009
The branch, master has been updated
via 1d5cd2a7c82d65320881345177e03da5b9363cc8 (commit)
from 2464f88cb52d2681767d6404025c3516553bd752 (commit)
Summary of changes:
lib/CSS/Squish.pm | 1 +
t/02-edge-cases.t | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 1d5cd2a7c82d65320881345177e03da5b9363cc8
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Tue Dec 8 18:54:58 2009 +0300
fix 'Modification of a read-only value attempted'
test and fix by localizing $_ variable
diff --git a/lib/CSS/Squish.pm b/lib/CSS/Squish.pm
index 22d3b28..3ac1805 100644
--- a/lib/CSS/Squish.pm
+++ b/lib/CSS/Squish.pm
@@ -217,6 +217,7 @@ sub _concatenate_to {
}
}
$self->_debug("Printing the rest");
+ local $_;
print $dest $_ while <$fh>;
close $fh;
}
diff --git a/t/02-edge-cases.t b/t/02-edge-cases.t
index 7866308..57f64d6 100644
--- a/t/02-edge-cases.t
+++ b/t/02-edge-cases.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 2;
+use Test::More tests => 3;
use Test::LongString;
use_ok("CSS::Squish");
@@ -66,3 +66,10 @@ my $result = CSS::Squish->concatenate('t/css/02-edge-cases.css');
is_string($result, $expected_result, "Edge cases");
+# bug in version 0.08 and older, result was error:
+# Modification of a read-only value attempted
+# at lib/CSS/Squish.pm line 220
+for ('t/css/02-edge-cases.css') {
+ $result = CSS::Squish->concatenate( $_ );
+}
+is_string($result, $expected_result, "no 'Modification of a read-only value'");
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list