skeleton register package
This commit is contained in:
24
reg/reg_test.go
Normal file
24
reg/reg_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package reg
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSpecBytes(t *testing.T) {
|
||||
cases := []struct {
|
||||
Spec Spec
|
||||
Bytes uint
|
||||
}{
|
||||
{S8L, 1},
|
||||
{S8H, 1},
|
||||
{S16, 2},
|
||||
{S32, 4},
|
||||
{S64, 8},
|
||||
{S128, 16},
|
||||
{S256, 32},
|
||||
{S512, 64},
|
||||
}
|
||||
for _, c := range cases {
|
||||
if c.Spec.Bytes() != c.Bytes {
|
||||
t.Errorf("%v.Bytes() = %d; expect = %d", c.Spec, c.Spec.Bytes(), c.Bytes)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user