diff options
Diffstat (limited to 'verify/core/storage_test.go')
-rw-r--r-- | verify/core/storage_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/verify/core/storage_test.go b/verify/core/storage_test.go new file mode 100644 index 0000000..65cc87c --- /dev/null +++ b/verify/core/storage_test.go @@ -0,0 +1,22 @@ +package core + +import "testing" + +func TestGethash(t *testing.T) { + node := Node{BlockStart: 0, BlockEnd: 0, BlockSum: "AA", PrevNodeSum: "hello"} + got, err := node.GetHash() + want := "87cdc950224b3850667c0f6a907a5c0dcf047425" + + if got != want || err != nil { + t.Errorf("got %s, wanted %s", got, want) + } +} + +func TestParseUnitSpec(t *testing.T) { + got := parseUnitSpec([]byte{0x0}) + want := 1 + + if got != want { + t.Errorf("got %d, wanted %d", got, want) + } +} |