skip

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package skip provides functions for skipping based on a condition.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func If

func If(t skipT, check func() bool, msgAndArgs ...interface{})

If skips the test if the check function returns true. The skip message will contain the name of the check function. Extra message text can be passed as a format string with args

Example
//   --- SKIP: TestName (0.00s)
//           skip.go:19: MissingFeature
If(t, MissingFeature)

//   --- SKIP: TestName (0.00s)
//           skip.go:19: MissingFeature: coming soon
If(t, MissingFeature, "coming soon")
Output:

func IfCondition

func IfCondition(t skipT, condition bool, msgAndArgs ...interface{})

IfCondition skips the test if the condition is true. The skip message will contain the source of the expression passed as the condition. Extra message text can be passed as a format string with args.

Example
//   --- SKIP: TestName (0.00s)
//           skip.go:19: apiVersion < version("v1.24")
IfCondition(t, apiVersion < version("v1.24"))

//   --- SKIP: TestName (0.00s)
//           skip.go:19: !textenv.hasFeature("build"): coming soon
IfCondition(t, !testEnv.hasFeature("build"), "coming soon")
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL