1package gopter 2 3import ( 4 "fmt" 5 "strings" 6) 7 8// PropArg contains information about the specific values for a certain property check. 9// This is mostly used for reporting when a property has falsified. 10type PropArg struct { 11 Arg interface{} 12 OrigArg interface{} 13 Label string 14 Shrinks int 15} 16 17func (p *PropArg) String() string { 18 return fmt.Sprintf("%v", p.Arg) 19} 20 21// PropArgs is a list of PropArg. 22type PropArgs []*PropArg 23 24// NewPropArg creates a new PropArg. 25func NewPropArg(genResult *GenResult, shrinks int, value, origValue interface{}) *PropArg { 26 return &PropArg{ 27 Label: strings.Join(genResult.Labels, ", "), 28 Arg: value, 29 OrigArg: origValue, 30 Shrinks: shrinks, 31 } 32} 33