| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
# Test for: |
| 4 |
# https://rt.cpan.org/Ticket/Display.html?id=93429 |
| 5 |
# |
| 6 |
# Contributed by Nick Wellnhofer. |
| 7 |
|
| 8 |
use strict; |
| 9 |
use warnings; |
| 10 |
|
| 11 |
use Test::More tests => 1; |
| 12 |
|
| 13 |
use XML::LibXML; |
| 14 |
|
| 15 |
{ |
| 16 |
my $err_html = '<html><body><lkj/></body></html>'; |
| 17 |
|
| 18 |
my $parser = XML::LibXML->new(); |
| 19 |
|
| 20 |
my $buf = ''; |
| 21 |
open(my $fh, '>', \$buf); |
| 22 |
|
| 23 |
{ |
| 24 |
local *STDERR = $fh; |
| 25 |
$parser->load_html( string => $err_html, recover => 2, ); |
| 26 |
} |
| 27 |
|
| 28 |
close($fh); |
| 29 |
|
| 30 |
is($buf, '', 'No warning emitted on load_html with recover => 2.'); |
| 31 |
} |
| 32 |
|