Procházet zdrojové kódy

Add some quick tests to test Others

Benjamin Sago před 4 roky
rodič
revize
fef516ec9c
1 změnil soubory, kde provedl 18 přidání a 0 odebrání
  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"));
+    }
+}