-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -899,27 +899,25 @@ mod tests { | |
r#"{"title": "Bar", "type": "string", "format": "email"}"#, | ||
EMAIL, | ||
vec![ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"user@[IPv6:2001:db8::1]", | ||
// Valid emails | ||
"[email protected]", // valid | ||
"[email protected]", // valid | ||
"[email protected]", // valid | ||
"[email protected]", // valid | ||
], | ||
vec![ | ||
"plainaddress", // missing '@' and domain | ||
"@missingusername.com", // missing username | ||
"[email protected]", // missing domain name | ||
"username@com", // TLD must have at least 2 characters | ||
"username@example,com", // invalid character in domain | ||
"[email protected]", // leading dot in domain is invalid | ||
"[email protected]", // domain cannot start with a hyphen | ||
"[email protected]", // domain cannot end with a hyphen | ||
"[email protected]", // double dot in domain name | ||
"[email protected]", // multiple errors in domain | ||
"[email protected]", // invalid IP format | ||
// Invalid emails | ||
"plainaddress", // missing '@' and domain | ||
"@missingusername.com", // missing username | ||
"[email protected]", // leading dot in domain | ||
"username@com", // TLD must have at least 2 characters | ||
"username@example,com", // invalid character in domain | ||
"[email protected]", // leading dot in domain | ||
"[email protected]", // double dot in domain name | ||
"[email protected]", // multiple errors in domain | ||
] | ||
), | ||
) | ||
|
||
] { | ||
let json: Value = serde_json::from_str(schema).expect("Can't parse json"); | ||
let result = to_regex(&json, None).expect("To regex failed"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters