From b16cf6df7c6a50bb4336fd82a883f1c4d27aa1e3 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 5 Jun 2023 20:46:02 +0200 Subject: [PATCH] add a test --- test/test.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test.ml b/test/test.ml index 7f45cd0..7326d50 100644 --- a/test/test.ml +++ b/test/test.ml @@ -10,9 +10,12 @@ let () = ; num_additionals = 0 } in + (* Header *) assert ( "\\x13\\x14\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00" = Utils.get_bytecode (Query.header_to_bytes data)); - assert ( - "\\x06google\\x03com\\x00" = Utils.get_bytecode (Query.encode_dns_name "google.com")) + (* Dns name *) + let dns_name = Query.encode_dns_name "google.com" in + assert ("\\x06google\\x03com\\x00" = Utils.get_bytecode dns_name); + assert (6 = Char.code (Bytes.get dns_name 0)) ;;