examples/complex: and bugfixes
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user