-
Notifications
You must be signed in to change notification settings - Fork 473
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
1 changed file
with
51 additions
and
0 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 |
---|---|---|
|
@@ -52,6 +52,57 @@ class TestEmailAddressDetector: | |
('[email protected]', True), | ||
('[email protected]', True), | ||
('[email protected]', True), | ||
# Additional test cases | ||
# Valid email addresses with different domain extensions | ||
('[email protected]', True), | ||
('[email protected]', True), | ||
('[email protected]', True), | ||
('[email protected]', True), | ||
# Valid email addresses with numbers | ||
('[email protected]', True), | ||
('[email protected]', True), | ||
('[email protected]', True), | ||
# Valid email addresses, part of larger text with special characters | ||
('Contact us at: [email protected]!', True), | ||
('Email: [email protected] for more info.', True), | ||
# Invalid email addresses with missing components | ||
('user@example', False), | ||
('[email protected]', False), | ||
('@example.com', False), | ||
('user@', False), | ||
# Invalid email addresses with special characters | ||
('user@exa*mple.com', False), | ||
('user@examp!e.com', False), | ||
('user@exampl$.com', False), | ||
('user@exam^ple.com', False), | ||
# Unusual formats, mark as false | ||
('"user"@example.com', False), # Quoted local part | ||
('user@[123.123.123.123]', False), # IP address domain | ||
# Invalid email addresses, incorrect use of special characters | ||
('user@exa,mple.com', False), | ||
('user@examp<le.com', False), | ||
('user@exampl>com', False), | ||
('user@exampl;e.com', False), | ||
# Edge cases - rare but valid email formats | ||
('user+mailbox/[email protected]', True), | ||
('customer/[email protected]', True), | ||
('!def!xyz%[email protected]', True), | ||
('[email protected]', True), | ||
# Edge cases - position of . (dot) | ||
('[email protected]', False), # Double dot in domain | ||
('[email protected]', True), # Leading dot in local part | ||
('[email protected]', False), # Leading dot in domain | ||
('[email protected].', True), # Trailing dot in domain | ||
], | ||
) | ||
def test_analyze_line(self, payload, should_flag): | ||
|