blob: 65cc87c4ae46b283aa6fc0d30ace850d4261b2e9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
}
}
|