run test (the same as the guide)
This commit is contained in:
parent
3f0cf9974e
commit
cd9fed4b99
1 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,17 @@
|
|||
open Dnstoy.Utils
|
||||
|
||||
let () =
|
||||
let data =
|
||||
{ id = 0x1314
|
||||
; flags = 0
|
||||
; num_questions = 1
|
||||
; num_answers = 0
|
||||
; num_authorities = 0
|
||||
; num_additionals = 0
|
||||
}
|
||||
in
|
||||
assert (
|
||||
"\\x13\\x14\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00"
|
||||
= get_bytecode (header_to_bytes data));
|
||||
assert ("\\x06google\\x03com\\x00" = get_bytecode (encode_dns_name "google.com"))
|
||||
;;
|
Reference in a new issue