Commit a81dd65a authored by Francesco Banconi's avatar Francesco Banconi

Clarify Format/SetFormat docstrings

parent 750ea19e
......@@ -8,9 +8,8 @@ import (
"github.com/kr/pretty"
)
// Format is the function used by default for formatting checker values and
// notes. It can be replaced on a specific c *qt.C instance by calling
// c.SetFormat().
// Format formats the given value as a string. It is used to print values in
// test failures unless that's changed by calling C.SetFormat.
func Format(v interface{}) string {
switch v := v.(type) {
case error:
......
......@@ -88,10 +88,10 @@ func (c *C) Cleanup() {
c.Done()
}
// SetFormat changes the format function used by this checker instance for
// generating the string representation of values in case of errors. The
// format function is called to format checker arguments and notes.
// By default qt.Format is used.
// SetFormat sets the function used to print values in test failures.
// By default Format is used.
// Any subsequent subtests invoked with c.Run will also use this function by
// default.
func (c *C) SetFormat(format func(interface{}) string) {
c.format = format
}
......
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