Documentation
¶
Overview ¶
Package qual implements tests and helpers for writing highly readable tests.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶ added in v0.2.0
Example ¶
// In this example the Assert call fails to show the output. The
// line just above Assert(...) will be printed for context if an
// error occurs.
val, err := 1, fmt.Errorf("This is an error")
Assert(t, Vars{val, err},
val == 2,
err != nil,
)
Output: > val, err := 1, fmt.Errorf("This is an error") failed assert: val == 2 val = 1 err = "This is an error"
Example (Nil) ¶
var err error
val, err := 9, nil
Assert(t, Vars{val, err},
val == 9,
err != nil,
)
Output: > val, err := 9, nil failed assert: err != nil val = 9 err = nil
Example (Oneline) ¶
val, err := 1, fmt.Errorf("This is an error")
Assert(t, Vars{val, err}, val == 2, err == nil)
Output: > val, err := 1, fmt.Errorf("This is an error") failed assert: val == 2 failed assert: err == nil val = 1 err = "This is an error"
func CyclomaticComplexity ¶
CyclomaticComplexity fails if max is exceeded in any go files of this project.
func High ¶
func High(t T)
High is the same as Standard, only it includes all vendor source as well.
func LineLength ¶
SourceWidth fails if any go file contains lines exceeding maxChars. All lines are considered, source and comments.
Types ¶
Click to show internal directories.
Click to hide internal directories.