1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
From: Enrico Tassi <gares@fettunta.org>
Date: Fri, 29 Nov 2013 17:37:39 +0100
Subject: split test into two parts: md5 and des56
---
tests/test.lua | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -6,6 +6,7 @@ if string.find(_VERSION, "Lua 5.0") then
LUA_PATH = "?;?.lua;/usr/local/share/lua/5.0/?.lua"
string.gmatch = string.gfind
end
+if select(1,...) == 'md5' then
local md5 = require"md5"
io.write (md5._VERSION..' '.._VERSION..'\n')
@@ -85,6 +86,7 @@ assert(md5.crypt('a','a',seed) ~= md5.cr
io.write'+'
+elseif select(1,...) == 'des56' then
-- Testing DES 56
local des56
@@ -119,3 +121,10 @@ key = string.sub(ascii, 2)
assert(des56.decrypt(des56.crypt(ascii, key), key) == ascii)
io.write'+\n'
+
+else
+
+ error 'Specify an algorithm to test'
+
+end
+
|