None

func None(notExpectedValues ...interface{}) TestDeep

None operator compares data against several not expected values. During a match, none of them have to match to succeed.

See also None godoc.

Examples

Base example

CmpNone shortcut

func CmpNone(t TestingT, got interface{}, notExpectedValues []interface{}, args ...interface{}) bool

CmpNone is a shortcut for:

Cmp(t, got, None(notExpectedValues...), args...)

See above for details.

Returns true if the test is OK, false if it fails.

args… are optional and allow to name the test. This name is used in case of failure to qualify the test. If len(args) > 1 and the first item of args is a string and contains a ‘%’ rune then fmt.Fprintf is used to compose the name, else args are passed to fmt.Fprint. Do not forget it is the name of the test, not the reason of a potential failure.

See also CmpNone godoc.

Examples

Base example

T.None shortcut

func (t *T) None(got interface{}, notExpectedValues []interface{}, args ...interface{}) bool

None is a shortcut for:

t.Cmp(got, None(notExpectedValues...), args...)

See above for details.

Returns true if the test is OK, false if it fails.

args… are optional and allow to name the test. This name is used in case of failure to qualify the test. If len(args) > 1 and the first item of args is a string and contains a ‘%’ rune then fmt.Fprintf is used to compose the name, else args are passed to fmt.Fprint. Do not forget it is the name of the test, not the reason of a potential failure.

See also T.None godoc.

Examples

Base example