diff options
| author | 2019-03-07 22:53:12 -0500 | |
|---|---|---|
| committer | 2019-03-07 22:53:12 -0500 | |
| commit | dfcaa25aac2a534b9dc286fddbfeae6c5e6864eb (patch) | |
| tree | 69852202db9e5a51bb561f83a5a7c4aeaca6f452 | |
| parent | Remove all mentions of p.toastin.space (diff) | |
[hash] Add unit test
| -rw-r--r-- | source/hash.d | 6 |
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); +} |
