From badc3a0929affb14415b178a96ee10151b795196 Mon Sep 17 00:00:00 2001 From: Flaviu Tamas Date: Sat, 23 May 2015 14:40:33 -0400 Subject: Add simple tests to secure_hash --- compiler/secure_hash.nim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/secure_hash.nim') diff --git a/compiler/secure_hash.nim b/compiler/secure_hash.nim index a2ddd02f0..3383f23a2 100644 --- a/compiler/secure_hash.nim +++ b/compiler/secure_hash.nim @@ -42,6 +42,11 @@ proc `==`*(a, b: SecureHash): bool = SHA1Digest(a) == SHA1Digest(b) +when isMainModule: + let hash1 = secureHash("a93tgj0p34jagp9[agjp98ajrhp9aej]") + doAssert hash1 == hash1 + doAssert parseSecureHash($hash1) == hash1 + # Copyright (c) 2011, Micael Hildenborg # All rights reserved. -- cgit 1.4.1-2-gfad0