Skip to content

Commit 44c24cf

Browse files
committed
Integrate "minifies to nothing" tests into t/minify.t
1 parent 7ea10d1 commit 44c24cf

2 files changed

Lines changed: 32 additions & 20 deletions

File tree

t/03-minifies-to-nothing.t

Lines changed: 0 additions & 20 deletions
This file was deleted.

t/minify.t

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,5 +279,37 @@ let html = `
279279
is $got, $expect;
280280
};
281281

282+
###############################################################################
283+
# JS that minifies to "nothing"
284+
subtest 'minifies to nothing' => sub {
285+
subtest 'block comment' => sub {
286+
my $given = '/* */';
287+
my $expect = undef;
288+
my $got = minify($given);
289+
is $got, $expect
290+
};
291+
292+
subtest 'line comment' => sub {
293+
my $given = '// foo';
294+
my $expect = undef;
295+
my $got = minify($given);
296+
is $got, $expect
297+
};
298+
299+
subtest 'just whitespace' => sub {
300+
my $given = " \r\n \t ";
301+
my $expect = undef;
302+
my $got = minify($given);
303+
is $got, $expect
304+
};
305+
306+
subtest 'empty string' => sub {
307+
my $given = '';
308+
my $expect = undef;
309+
my $got = minify($given);
310+
is $got, $expect
311+
};
312+
};
313+
282314
###############################################################################
283315
done_testing();

0 commit comments

Comments
 (0)