From 36f143bcc2c1d9aef957daf78d98d0d2b685b061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Wed, 25 Sep 2019 16:12:54 +0200 Subject: [PATCH] add dump hex test --- tests/test_io.nim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_io.nim b/tests/test_io.nim index 3d29c4e..fe1f9fe 100644 --- a/tests/test_io.nim +++ b/tests/test_io.nim @@ -85,6 +85,15 @@ suite "Testing input and output procedures": # TODO: negative hex test "Hex dump": + + block: + let a = 0x1234567890ABCDEF.stint(128) + check: a.dumpHex(bigEndian).toUpperAscii == "00000000000000001234567890ABCDEF" + + block: + let a = 0x1234567890ABCDEF.stuint(128) + check: a.dumpHex(bigEndian).toUpperAscii == "00000000000000001234567890ABCDEF" + block: let a = 0x1234'i32.stint(32) check: a.dumpHex(bigEndian).toUpperAscii == "00001234"