examples/complex: and bugfixes

This commit is contained in:
Michael McLoughlin
2018-12-12 00:02:22 -08:00
parent 2189d38d1e
commit b89d211ff4
12 changed files with 179 additions and 34 deletions

View File

@@ -7,14 +7,15 @@ import (
//go:generate go run asm.go -out sum.s -stubs stub.go
func expect(xs []uint64) uint64 {
var s uint64
for _, x := range xs {
s += x
}
return s
}
func TestSum(t *testing.T) {
quick.CheckEqual(Sum, expect, nil)
expect := func(xs []uint64) uint64 {
var s uint64
for _, x := range xs {
s += x
}
return s
}
if err := quick.CheckEqual(Sum, expect, nil); err != nil {
t.Fatal(err)
}
}