summary refs log tree commit diff stats
path: root/compiler/secure_hash.nim
diff options
context:
space:
mode:
authorFlaviu Tamas <tamasflaviu@gmail.com>2015-05-23 14:40:33 -0400
committerFlaviu Tamas <tamasflaviu@gmail.com>2015-05-26 09:40:01 -0400
commitbadc3a0929affb14415b178a96ee10151b795196 (patch)
tree30cf752d33bf13e857ebe0f3b9ca4df372ee6bbe /compiler/secure_hash.nim
parente9516e6308687d3c92564ac54fc63f19470ccf2b (diff)
downloadNim-badc3a0929affb14415b178a96ee10151b795196.tar.gz
Add simple tests to secure_hash
Diffstat (limited to 'compiler/secure_hash.nim')
-rw-r--r--compiler/secure_hash.nim5
1 files changed, 5 insertions, 0 deletions
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.