zeroclickinfo-goodies/t/EmailValidator.t

27 lines
1.1 KiB
Perl
Raw Normal View History

2013-09-08 14:06:48 -07:00
#! /usr/bin/env perl
use strict;
use warnings;
use Test::More;
use DDG::Test::Goodie;
zci answer_type => 'emailvalidator';
zci is_cached => 0;
ddg_goodie_test(
[
'DDG::Goodie::EmailValidator'
],
'validate foo' => undef,
'validate my email foo@example.com' => test_zci (qr/seems to be valid/),
'validate my email foo+abc@example.com' => test_zci (qr/seems to be valid/),
'validate my email foo.bar@example.com' => test_zci (qr/seems to be valid/),
'validate user@exampleaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com' => test_zci (qr/Please check the address/),
2013-09-08 14:06:48 -07:00
'validate foo@example.com' => test_zci (qr/seems to be valid/),
2013-10-28 11:33:26 -07:00
'validate customer/department=shipping@example.com' => test_zci (qr/seems to be valid/),
'validate foo@!!!.com' => test_zci(qr/Please check the fully qualified domain name/),
'validate foo@example.xyz' => test_zci(qr/Please check the top-level domain/),
2013-09-08 14:06:48 -07:00
);
done_testing;