Browse Source

Add some quick tests to test Others

Benjamin Sago 4 years ago
parent
commit
fef516ec9c
1 changed files with 18 additions and 0 deletions
  1. 18 0
      dns/src/record/others.rs

+ 18 - 0
dns/src/record/others.rs

@@ -69,3 +69,21 @@ static TYPES: &[(&str, u16)] = &[
     ("TSIG",      250),
     ("URI",       256),
 ];
+
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn known() {
+        assert_eq!(UnknownQtype::from(46).to_string(),
+                   String::from("RRSIG"));
+    }
+
+    #[test]
+    fn unknown() {
+        assert_eq!(UnknownQtype::from(4444).to_string(),
+                   String::from("4444"));
+    }
+}