-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a test for the clone functionality.
- Loading branch information
Daniel Tashjian
committed
Sep 14, 2021
1 parent
f59275a
commit 356a343
Showing
1 changed file
with
18 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use email_address_parser::EmailAddress; | ||
|
||
#[test] | ||
fn test_clone() { | ||
let actual: EmailAddress; | ||
|
||
{ | ||
let expected = EmailAddress::new("foo", "bar.com", None).unwrap(); | ||
actual = expected.clone(); | ||
|
||
// check they are the same | ||
assert_eq!(&expected, &actual); | ||
} | ||
|
||
// ensure it exists after the source is dropped | ||
assert_eq!(&"foo", &actual.get_local_part()); | ||
assert_eq!(&"bar.com", &actual.get_domain()); | ||
} |