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