Commit 272c0d21 authored by Anthony Fok's avatar Anthony Fok

New upstream version 1.4.1

parents 2738d87c 2b14d63b
......@@ -5,10 +5,19 @@ package quicktest
var Prefixf = prefixf
// WithVerbosity returns the given checker with a verbosity level of v.
// A copy of the original checker is made if mutating it is required.
// A copy of the original checker is made if mutating is required.
func WithVerbosity(c Checker, v bool) Checker {
if c, ok := c.(*cmpEqualsChecker); ok {
c := *c
switch checker := c.(type) {
case *allChecker:
c := *checker
c.elemChecker = WithVerbosity(c.elemChecker, v)
return &c
case *anyChecker:
c := *checker
c.elemChecker = WithVerbosity(c.elemChecker, v)
return &c
case *cmpEqualsChecker:
c := *checker
c.verbose = func() bool {
return v
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment