diff options
author | Klara Modin <kasm@kasm.eu> | 2018-05-16 22:59:23 +0200 |
---|---|---|
committer | Klara Modin <kasm@kasm.eu> | 2018-05-16 22:59:23 +0200 |
commit | 94c275de81d74f76f9e8c45dcfd8bf57a3a500a2 (patch) | |
tree | 7e1a895baf9a3837b5d1c66e6c097ea414ca9a3d | |
parent | 79c7657be1d723cc57cffd13e152ec5ce5bae5c0 (diff) |
fix tests
-rw-r--r-- | src/tests.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tests.rs b/src/tests.rs index 12ba95f..2b8b73b 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -9,7 +9,7 @@ mod message { params: Vec::new(), }; - let actual = Message::from_string(&"motd\r\n".to_string()); + let actual = Message::from_str("motd\r\n"); assert_eq!(proper, actual); } @@ -22,7 +22,7 @@ mod message { params: vec!["Server is going down for maintenance".to_string()], }; - let actual = Message::from_string(&"WALLOPS :Server is going down for maintenance\r\n".to_string()); + let actual = Message::from_str("WALLOPS :Server is going down for maintenance\r\n"); assert_eq!(proper, actual); } @@ -35,25 +35,25 @@ mod message { params: vec!["user".to_string(), "irc.example.org".to_string()], }; - let actual = Message::from_string(&"PING user irc.example.org\r\n".to_string()); + let actual = Message::from_str("PING user irc.example.org\r\n"); assert_eq!(proper, actual); } #[test] fn trailing_is_same_as_normal_when_trailing_has_no_space() { - let normal = Message::from_string(&"PING irc.example.org\r\n".to_string()); - let trailing = Message::from_string(&"PING :irc.example.org\r\n".to_string()); + let normal = Message::from_str("PING irc.example.org\r\n"); + let trailing = Message::from_str("PING :irc.example.org\r\n"); assert_eq!(normal, trailing); } #[test] fn handles_differing_newlines() { - let windows = Message::from_string(&"PING irc.example.org\r\n".to_string()); - let unix = Message::from_string(&"PING irc.example.org\n".to_string()); - let oldmac = Message::from_string(&"PING irc.example.org\r".to_string()); - let none = Message::from_string(&"PING irc.example.org".to_string()); + let windows = Message::from_str("PING irc.example.org\r\n"); + let unix = Message::from_str("PING irc.example.org\n"); + let oldmac = Message::from_str("PING irc.example.org\r"); + let none = Message::from_str("PING irc.example.org"); assert_eq!(none, windows); assert_eq!(none, unix); |