1pub use buffers::{Buffer, MessageBuffer, TagBuffer};
7pub use command::Command;
8pub use message::{
9 MESSAGE_LENGTH,
10 Message,
11 PARAMS_LENGTH,
12 Tag,
13 tag_escape,
14 tags,
15};
16
17mod buffers;
18mod command;
19mod message;
20pub mod mode;
21pub mod rpl;
22
23pub fn assert_msg(msg: &Message<'_>, prefix: Option<&str>, command: Result<Command, &str>,
28 params: &[&str])
29{
30 assert_eq!(msg.prefix, prefix, "prefix of {:?}", msg);
31 assert_eq!(msg.command, command, "command of {:?}", msg);
32 assert_eq!(msg.num_params, params.len(), "number of parameters of {:?}", msg);
33 for (i, (actual, expected)) in msg.params.iter().zip(params.iter()).enumerate() {
34 if expected.is_empty() {
35 continue;
38 }
39 assert_eq!(actual, expected, "parameter #{} of {:?}", i, msg);
40 }
41}