From cd9fed4b9951775537db3a1756bbadd9ce79e213 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 5 Jun 2023 19:57:20 +0200 Subject: [PATCH] run test (the same as the guide) --- test/dnstoy.ml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/dnstoy.ml b/test/dnstoy.ml index e69de29..965882e 100644 --- a/test/dnstoy.ml +++ b/test/dnstoy.ml @@ -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")) +;;