3 # This test will simply run the parser on random junk.
5 my $no_tests = shift || 3;
7 plan tests => $no_tests;
11 my $file = "junk$$.html";
16 open(JUNK, ">$file") || die;
17 for (1 .. rand(5000)) {
18 for (1 .. rand(200)) {
19 print JUNK pack("N", rand(2**32));
21 print JUNK ("<", "&", ">")[rand(3)]; # make these a bit more likely
25 #diag "Parse @{[-s $file]} bytes of junk";
27 HTML::Parser->new->parse_file($file);
38 # this probably only works on Linux
39 open(STAT, "/proc/self/status") || return;