Fix XML isValid fail.
parent
e966e2e5fa
commit
e3ae29c9bd
|
@ -21,7 +21,10 @@ handle remainder => sub {
|
||||||
XMLin $_;
|
XMLin $_;
|
||||||
return 'valid!';
|
return 'valid!';
|
||||||
} catch {
|
} catch {
|
||||||
$_ =~ /^\n(.* at line \d+, column \d+, byte \d+) at/;
|
|
||||||
|
# warn $_;
|
||||||
|
|
||||||
|
$_ =~ /^\n?(.* at line \d+, column \d+, byte \d+) at/;
|
||||||
|
|
||||||
return ('invalid: ', $1);
|
return ('invalid: ', $1);
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,8 +36,8 @@ ddg_goodie_test(
|
||||||
ddg_goodie_test(
|
ddg_goodie_test(
|
||||||
[qw(DDG::Goodie::IsValid::XML)],
|
[qw(DDG::Goodie::IsValid::XML)],
|
||||||
'is valid xml <test>lol' => test_zci(
|
'is valid xml <test>lol' => test_zci(
|
||||||
'Your XML is invalid: no element found at line 1, column 9, byte 9',
|
'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 9, byte 9</pre>'
|
html => 'Your XML is invalid: <pre style="font-size:12px;margin-top:5px;">no element found at line 1, column 10, byte 9</pre>'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue