Bug 1509493 - Provide basic test coverage for email address parsing r=BenB

Depends on D13511

Differential Revision: https://phabricator.services.mozilla.com/D13644

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Fabian Henneke 2018-12-02 22:14:11 +00:00
Родитель 0d5da0fca2
Коммит e00f50248b
1 изменённых файлов: 20 добавлений и 0 удалений

Просмотреть файл

@ -16,16 +16,28 @@ function run_test() {
input: "RFC1738: <URL:http://mozilla.org> then",
url: "http://mozilla.org"
},
{
input: "RFC1738: <URL:mailto:john.doe+test@mozilla.org> then",
url: "mailto:john.doe+test@mozilla.org"
},
// -- RFC2396E
{
input: "RFC2396E: <http://mozilla.org/> then",
url: "http://mozilla.org/"
},
{
input: "RFC2396E: <john.doe+test@mozilla.org> then",
url: "mailto:john.doe+test@mozilla.org"
},
// -- abbreviated
{
input: "see www.mozilla.org maybe",
url: "http://www.mozilla.org"
},
{
input: "mail john.doe+test@mozilla.org maybe",
url: "mailto:john.doe+test@mozilla.org"
},
// -- delimiters
{
input: "see http://www.mozilla.org/maybe today", // Spaces
@ -85,10 +97,18 @@ function run_test() {
input: "bracket: http://localhost/[1] etc.",
url: "http://localhost/"
},
{
input: "bracket: john.doe+test@mozilla.org[1] etc.",
url: "mailto:john.doe+test@mozilla.org"
},
{
input: "parenthesis: (http://localhost/) etc.",
url: "http://localhost/"
},
{
input: "parenthesis: (john.doe+test@mozilla.org) etc.",
url: "mailto:john.doe+test@mozilla.org"
},
{
input: "(thunderbird)http://mozilla.org/thunderbird",
url: "http://mozilla.org/thunderbird"