From dfcaa25aac2a534b9dc286fddbfeae6c5e6864eb Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Thu, 7 Mar 2019 22:53:12 -0500 Subject: [hash] Add unit test --- source/hash.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/hash.d b/source/hash.d index 3071fa3..5a3028e 100644 --- a/source/hash.d +++ b/source/hash.d @@ -11,3 +11,9 @@ pure string hash(T : string)(T data) { import std.string; return hash(data.representation); } + +unittest { + immutable(ubyte)[] a = [ 'b', 'r', 'p', 'a', 's', 't', 'e' ]; + string s = "brpaste"; + assert(a.hash == s.hash); +} -- cgit v1.2.3