Skip to content

Instantly share code, notes, and snippets.

@quii
Created March 7, 2016 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quii/a0240ef3c4c4a60d7616 to your computer and use it in GitHub Desktop.
Save quii/a0240ef3c4c4a60d7616 to your computer and use it in GitHub Desktop.
type LatLong struct{
Lat float64
Long float64
}
func (l LatLong) Generate(rand *rand.Rand, size int) reflect.Value{
randomLatLong := LatLong{
Lat: rand.Float64(),
Long: rand.Float64(),
}
return reflect.ValueOf(randomLatLong)
}
func TestLatLongIsAlwaysTrue(t *testing.T){
assertion := func(x LatLong) bool {
t.Log("Random LatLong:", x)
//todo: Do some interesting assertions!
return true
}
if err := quick.Check(assertion, nil); err != nil {
t.Error(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment