From 841e8bd9fa512de81999a26e544ccc137b09adfc Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Tue, 11 Nov 2014 15:52:28 +0100 Subject: [PATCH] add test for md5 implementation --- spec/unit/md5_spec.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 spec/unit/md5_spec.lua diff --git a/spec/unit/md5_spec.lua b/spec/unit/md5_spec.lua new file mode 100644 index 000000000..fb59b864a --- /dev/null +++ b/spec/unit/md5_spec.lua @@ -0,0 +1,12 @@ +require("commonrequire") + +local md5 = require("MD5") + +describe("MD5 module", function() + it("should calculate correct MD5 hashes", function() + assert.is_equal(md5(""), "d41d8cd98f00b204e9800998ecf8427e") + assert.is_equal(md5("\0"), "93b885adfe0da089cdf634904fd59f71") + assert.is_equal(md5("0123456789abcdefX"), "1b05aba914a8b12315c7ee52b42f3d35") + end) +end) +