summaryrefslogtreecommitdiffstats
path: root/lib/hash_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hash_test.go')
-rw-r--r--lib/hash_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/hash_test.go b/lib/hash_test.go
new file mode 100644
index 0000000..bde6b3f
--- /dev/null
+++ b/lib/hash_test.go
@@ -0,0 +1,16 @@
+// Copyright © 2022 siddharth <s@ricketyspace.net>
+// SPDX-License-Identifier: ISC
+
+package lib
+
+import (
+ "testing"
+)
+
+func TestShaShr(t *testing.T) {
+ s := uint32(256)
+ sr := shaShr(s, 2)
+ if sr != s>>2 {
+ t.Errorf("shaShr test failed")
+ }
+}