summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toastin.space>2019-03-07 22:53:12 -0500
committerChloe Kudryavtsev <toast@toastin.space>2019-03-07 22:53:12 -0500
commitdfcaa25aac2a534b9dc286fddbfeae6c5e6864eb (patch)
tree69852202db9e5a51bb561f83a5a7c4aeaca6f452
parentRemove all mentions of p.toastin.space (diff)
[hash] Add unit test
-rw-r--r--source/hash.d6
1 files changed, 6 insertions, 0 deletions
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);
+}