1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
#!/usr/bin/perl -w
use strict;
use warnings;
use Test::More tests => 3;
use Test::LongString;
use_ok("CSS::Squish");
my $expected_result = <<'EOT';
/**
* From t/css/02-edge-cases.css: @import "blam.css" print;
*/
@media print {
Blam!
}
/** End of blam.css */
/**
* From t/css/02-edge-cases.css: @import "blam.css";
*/
Blam!
/** End of blam.css */
/**
* From t/css/02-edge-cases.css: @import url( "foo.css") print,aural;
*/
@media aural, print {
foo1
}
/** End of foo.css */
/**
* From t/css/02-edge-cases.css: @import url(foo2.css ) print, aural, tty;
*/
@media aural, print, tty {
foo2
}
/** End of foo2.css */
/* WARNING: Unable to find import 'failure.css' */
@import 'failure.css' print;
fjkls
jk
@import url("foo.css");
last
EOT
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'");
|