Back to godoc.org
gotest.tools / skip

Package skip

v2.2.0+incompatible
Latest Go to latest
Published: Nov 11, 2018 | License: Apache-2.0 | Module: gotest.tools

Overview

Package skip provides functions for skipping a test and printing the source code of the condition used to skip the test.

Index

Examples

Package Files

func If

func If(t skipT, condition BoolOrCheckFunc, msgAndArgs ...interface{})

If the condition expression evaluates to true, or the condition function returns true, skip the test. The skip message will contain the source code of the expression. Extra message text can be passed as a format string with args

Example

Code:

skip.If(t, MissingFeature)

skip.If(t, MissingFeature, "coming soon")
Example (WithExpression)

Code:

skip.If(t, apiVersion < version("v1.24"))

skip.If(t, !testEnv.hasFeature("build"), "coming soon")

type BoolOrCheckFunc

type BoolOrCheckFunc interface{}

BoolOrCheckFunc can be a bool or func() bool, other types will panic

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier