Преглед на файлове

Use pretty_assertions in dns crate too

Benjamin Sago преди 4 години
родител
ревизия
c3daf96a50

+ 1 - 0
Cargo.lock

@@ -172,6 +172,7 @@ dependencies = [
  "byteorder",
  "log",
  "mutagen",
+ "pretty_assertions",
 ]
 
 [[package]]

+ 2 - 0
dns/Cargo.toml

@@ -16,6 +16,8 @@ byteorder = "1.3"
 # testing
 mutagen = { git = "https://github.com/llogiq/mutagen", optional = true }
 
+[dev-dependencies]
+pretty_assertions = "0.6"
 
 [features]
 with_mutagen = ["mutagen"]  # needs nightly

+ 1 - 0
dns/src/record/a.rs

@@ -44,6 +44,7 @@ impl Wire for A {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/aaaa.rs

@@ -46,6 +46,7 @@ impl Wire for AAAA {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/caa.rs

@@ -74,6 +74,7 @@ impl Wire for CAA {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses_non_critical() {

+ 1 - 0
dns/src/record/cname.rs

@@ -40,6 +40,7 @@ impl Wire for CNAME {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/hinfo.rs

@@ -67,6 +67,7 @@ impl Wire for HINFO {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/mx.rs

@@ -49,6 +49,7 @@ impl Wire for MX {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/ns.rs

@@ -41,6 +41,7 @@ impl Wire for NS {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/opt.rs

@@ -116,6 +116,7 @@ impl OPT {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses_no_data() {

+ 1 - 0
dns/src/record/ptr.rs

@@ -46,6 +46,7 @@ impl Wire for PTR {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/soa.rs

@@ -88,6 +88,7 @@ impl Wire for SOA {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/srv.rs

@@ -62,6 +62,7 @@ impl Wire for SRV {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses() {

+ 1 - 0
dns/src/record/txt.rs

@@ -64,6 +64,7 @@ impl Wire for TXT {
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn parses_one_iteration() {

+ 1 - 0
dns/src/strings.rs

@@ -180,6 +180,7 @@ fn read_string_recursive(labels: &mut Labels, c: &mut Cursor<&[u8]>, recursions:
 #[cfg(test)]
 mod test {
     use super::*;
+    use pretty_assertions::assert_eq;
 
     // The buffers used in these tests contain nothing but the labels we’re
     // decoding. In DNS packets found in the wild, the cursor will be able to

+ 1 - 0
dns/src/wire.rs

@@ -452,6 +452,7 @@ mod test {
     use super::*;
     use crate::record::{Record, A, SOA, OPT, UnknownQtype};
     use std::net::Ipv4Addr;
+    use pretty_assertions::assert_eq;
 
     #[test]
     fn complete_response() {