Explorar o código

Add some quick tests to test Others

Benjamin Sago %!s(int64=4) %!d(string=hai) anos
pai
achega
fef516ec9c
Modificáronse 1 ficheiros con 18 adicións e 0 borrados
  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"));
+    }
+}