File: 03-leaks.t

package info (click to toggle)
libjavascript-packer-perl 2.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,280 kB
  • sloc: javascript: 16,839; perl: 868; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 655 bytes parent folder | download | duplicates (5)
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
#!perl

use strict;
use warnings;

use Test::More;
use JavaScript::Packer; 

if (! eval "use Test::Memory::Cycle; 1;" ) {
	plan skip_all => 'Test::Memory::Cycle required for this test';
}

my $packer = JavaScript::Packer->init;
memory_cycle_ok( $packer );

my $js = '
$(document).ready(function(e) {
try {
//  $("body select").msDropDown();
$("#payin").msDropdown({visibleRows:3,rowHeight:30});
$("#payout").msDropdown({visibleRows:8,rowHeight:30});
$("#lang").msDropdown({visibleRows:2,rowHeight:16});

} catch(e) {
	alert(e.message);
}
});
';

for ( 1 .. 5 ) { 
	ok( $packer->minify( \$js,{} ),'minify' );
}

memory_cycle_ok( $packer );
done_testing();