Files
avo/reg/reg_test.go

25 lines
368 B
Go
Raw Normal View History

2018-11-11 22:17:06 -06:00
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)
}
}
}