소스 검색

Add some quick tests to test Others

Benjamin Sago 4 년 전
부모
커밋
fef516ec9c
1개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  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"));
+    }
+}