DRY in t/IsValid
parent
d13f56dbb9
commit
201266bb0e
12
t/IsValid.t
12
t/IsValid.t
|
@ -14,11 +14,7 @@ ddg_goodie_test(
|
|||
'is valid json {"test":"lol"}' => test_zci(
|
||||
'Your JSON is valid!',
|
||||
html => 'Your JSON is valid!'
|
||||
)
|
||||
);
|
||||
|
||||
ddg_goodie_test(
|
||||
[qw(DDG::Goodie::IsValid::JSON)],
|
||||
),
|
||||
'is valid json {"test" "lol"}' => test_zci(
|
||||
'Your JSON is invalid: \':\' expected, at character offset 8 (before ""lol"}")',
|
||||
html => 'Your JSON is invalid: <pre style="font-size:12px;margin-top:5px;">\':\' expected, at character offset 8 (before ""lol"}")</pre>'
|
||||
|
@ -30,11 +26,7 @@ ddg_goodie_test(
|
|||
'is valid xml <test></test>' => test_zci(
|
||||
'Your XML is valid!',
|
||||
html => 'Your XML is valid!'
|
||||
)
|
||||
);
|
||||
|
||||
ddg_goodie_test(
|
||||
[qw(DDG::Goodie::IsValid::XML)],
|
||||
),
|
||||
'is valid xml <test>lol' => test_zci(
|
||||
qr/Your XML is invalid: (no element found at line \d{1,2}, column \d{1,2}, byte \d{1,2}|Premature end of data .*)/,
|
||||
html => qr/Your XML is invalid: <pre style="font-size:12px;margin-top:5px;">(no element found at line \d{1,2}, column \d{1,2}, byte \d{1,2}|Premature end of data .*)<\/pre>/
|
||||
|
|
Loading…
Reference in New Issue