Skip to content

Commit

Permalink
Added a test for the clone functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Tashjian committed Sep 14, 2021
1 parent f59275a commit 356a343
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions rust-lib/tests/email_address_tests.rs
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());
}

0 comments on commit 356a343

Please sign in to comment.