diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2012-01-23 17:13:37 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2012-01-23 17:13:37 +0100 |
commit | 96624a115fe60b8ebdbbecbc2b38a7566d4e4c59 (patch) | |
tree | 7b7c92645371edd42efe647c4c731f0a971f4e71 /t | |
parent | 3d3cb31a1f4f7c09de165805298e4ea2feaba7cd (diff) | |
download | bugs-96624a115fe60b8ebdbbecbc2b38a7566d4e4c59.tar bugs-96624a115fe60b8ebdbbecbc2b38a7566d4e4c59.tar.gz bugs-96624a115fe60b8ebdbbecbc2b38a7566d4e4c59.tar.bz2 bugs-96624a115fe60b8ebdbbecbc2b38a7566d4e4c59.tar.xz bugs-96624a115fe60b8ebdbbecbc2b38a7566d4e4c59.zip |
Bug 319953: Missing real email syntax check
r=glob a=LpSolit
Diffstat (limited to 't')
-rw-r--r-- | t/007util.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/007util.t b/t/007util.t index e21ec28f8..a73f4dfa7 100644 --- a/t/007util.t +++ b/t/007util.t @@ -11,7 +11,7 @@ use lib 't'; use Support::Files; -use Test::More tests => 15; +use Test::More tests => 17; BEGIN { use_ok(Bugzilla); @@ -58,6 +58,16 @@ foreach my $input (keys %email_strings) { "email_filter('$input')"); } +# validate_email_syntax. We need to override some parameters. +my $params = Bugzilla->params; +$params->{emailregexp} = '.*'; +$params->{emailsuffix} = ''; +my $ascii_email = 'admin@company.com'; +# U+0430 returns the Cyrillic "а", which looks similar to the ASCII "a". +my $utf8_email = "\N{U+0430}dmin\@company.com"; +ok(validate_email_syntax($ascii_email), 'correctly formatted ASCII-only email address is valid'); +ok(!validate_email_syntax($utf8_email), 'correctly formatted email address with non-ASCII characters is rejected'); + # diff_arrays(): my @old_array = qw(alpha beta alpha gamma gamma beta alpha delta epsilon gamma); my @new_array = qw(alpha alpha beta gamma epsilon delta beta delta); |