diff options
| author | Kevin J Hoerr <kjhoerr@submelon.tech> | 2019-10-30 10:20:12 -0400 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@submelon.tech> | 2019-10-30 10:20:12 -0400 |
| commit | d133f7a23aa758c7ecd65c9e32c711e8475d0e06 (patch) | |
| tree | 4cf0b8b4b30d077eed2f1f600a16e819cef27d8f /src/messages/not_understood.rs | |
| parent | b3a313f8e5e0185104727e75747251121eddf92d (diff) | |
| download | august-offensive-d133f7a23aa758c7ecd65c9e32c711e8475d0e06.tar.gz august-offensive-d133f7a23aa758c7ecd65c9e32c711e8475d0e06.tar.bz2 august-offensive-d133f7a23aa758c7ecd65c9e32c711e8475d0e06.zip | |
Simplify unit testing on messages using Clone
Diffstat (limited to 'src/messages/not_understood.rs')
| -rw-r--r-- | src/messages/not_understood.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/messages/not_understood.rs b/src/messages/not_understood.rs index 6c2c3ae..b567676 100644 --- a/src/messages/not_understood.rs +++ b/src/messages/not_understood.rs @@ -1,6 +1,6 @@ use messages::Message; -#[derive(Debug, Serialize)] +#[derive(Clone, Debug, Serialize)] pub struct NotUnderstood { pub path: Vec<String>, } @@ -37,12 +37,13 @@ mod tests { fn test_asoutgoing() { // Arrange let message = NotUnderstood { path: vec![] }; + let message_ref = message.clone(); // Act let outgoing = message.as_outgoing(); // Assert assert_eq!(outgoing.result_type, "NOT_UNDERSTOOD"); - assert_eq!(outgoing.content, NotUnderstood { path: vec![] }); + assert_eq!(outgoing.content, message_ref); } } |
