File: calc.t

package info (click to toggle)
libcss-compressor-perl 0.05-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 396 kB
  • sloc: perl: 167; javascript: 70; sh: 49; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 461 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

use Test::More
    tests => 2;

BEGIN {
    use_ok('CSS::Compressor' => qw( css_compress ) );
}

my $result = css_compress(<<CSS);
/* calc test */
p + p {
    width: calc(100vw - 20px + 11%);
    height: calc(100vh + 10px - 5%);
    top: calc(100% / 3 * 2);
    left: calc(10% * var(--foo) + 10px);
}
CSS

is $result => 'p+p{width:calc(100vw - 20px + 11%);height:calc(100vh + 10px - 5%);top:calc(100% / 3 * 2);left:calc(10% * var(--foo) + 10px)}' => 'match';