diff --git a/src/proto.rs b/src/proto.rs index 73bbd52..da0a989 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -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(()) }