Improve tests
This commit is contained in:
parent
00ac8cbb4f
commit
e0cc382eeb
@ -237,7 +237,7 @@ mod tests {
|
||||
assert_eq!(
|
||||
parse_result.err(),
|
||||
Some(DNSParseError::DNSOpCodeInvalid),
|
||||
"query: {:?}, opcode: {}",
|
||||
"query: {:02x?}, opcode: {}",
|
||||
dns_query,
|
||||
opcode
|
||||
);
|
||||
@ -261,7 +261,11 @@ mod tests {
|
||||
for (idx, opcode) in valid_opcodes.iter().enumerate() {
|
||||
dns_query[2] = opcode << 3;
|
||||
let parse_result = DNSHeader::from_udp_datagram(&dns_query);
|
||||
assert_eq!(parse_result?.opcode, valid_parsed_opcodes[idx]);
|
||||
assert_eq!(
|
||||
parse_result?.opcode, valid_parsed_opcodes[idx],
|
||||
"query: {:02x?}, opcode: {}",
|
||||
dns_query, opcode
|
||||
);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user