Fix XML isValid fail.

master
yegg 2012-09-07 10:46:59 -04:00
parent e966e2e5fa
commit e3ae29c9bd
2 changed files with 6 additions and 3 deletions

View File

@ -21,7 +21,10 @@ handle remainder => sub {
XMLin $_;
return 'valid!';
} catch {
$_ =~ /^\n(.* at line \d+, column \d+, byte \d+) at/;
# warn $_;
$_ =~ /^\n?(.* at line \d+, column \d+, byte \d+) at/;
return ('invalid: ', $1);
};

View File

@ -36,8 +36,8 @@ ddg_goodie_test(
ddg_goodie_test(
[qw(DDG::Goodie::IsValid::XML)],
'is valid xml <test>lol' => test_zci(
'Your XML is invalid: no element found at line 1, column 9, byte 9',
html => 'Your XML is invalid: <pre style="font-size:12px;margin-top:5px;">no element found at line 1, column 9, byte 9</pre>'
'Your XML is invalid: no element found at line 1, column 10, byte 9',
html => 'Your XML is invalid: <pre style="font-size:12px;margin-top:5px;">no element found at line 1, column 10, byte 9</pre>'
)
);