given a command enum, and an expect string, asserts that command is serialized / deserialized appropiately
(command: &UserCommand, expected: &str)
| 48 | |
| 49 | // given a command enum, and an expect string, asserts that command is serialized / deserialized appropiately |
| 50 | fn assert_command_serialization(command: &UserCommand, expected: &str) { |
| 51 | let serialized = serde_json::to_string(&command).unwrap(); |
| 52 | assert_eq!(serialized, expected); |
| 53 | let deserialized: UserCommand = serde_json::from_str(&serialized).unwrap(); |
| 54 | assert_eq!(deserialized, *command); |
| 55 | } |
| 56 | |
| 57 | #[test] |
| 58 | fn test_join_command() { |
no outgoing calls