Standard library / testing/quick

testing/quick.CheckError

Counterexample from Check; Count identifies the trial and In contains the arguments that made the property false. Expected stdout: 'true 1 1\n'.

Formal Syntax & Structure

go syntaxgo
type CheckError struct {  Count int  In    []any}

Working Example

Example Snippetgo
package main
import (  "errors"  "fmt"  "testing/quick")
func main() {  err := quick.Check(func(x int) bool { return false }, &quick.Config{MaxCount: 1})  var e *quick.CheckError  fmt.Println(errors.As(err, &e), e.Count, len(e.In))}
Go Reference