XU XUv0.16.0

#testing

import: #testing

counts: 4 functions, 22 methods, 2 types, 0 constants, 0 method sets

T: error/fatal/skip/run and *f formatters. LIFO cleanup. Cannot import outside test builds.

struct T

XuAPI
pub struct T {
    pub failed int
    pub skipped int
    pub name string
    pub cleanups []fn()
}

Purpose

Structure encapsulating failed, skipped, name, cleanups.

Public fields

failed int
field (int)
skipped int
field (int)
name string
name
cleanups []fn()
field ([]fn())

t

XuAPI
pub fn t() T

Purpose

Execute t.

Parameters

No arguments are required.

Returns

T — a value of this type

t_named

XuAPI
pub fn t_named(name string) T

Purpose

T named.

Parameters

name string
name (string)

Returns

T — a value of this type

(T) name

XuAPI
pub fn (t T) name() string

Purpose

Execute name on T.

Parameters

t T
The T instance used by this call (value receiver).

Returns

string — result string

(T) helper

XuAPI
pub fn (t T) helper()

Purpose

Execute helper on T.

Parameters

t T
The T instance used by this call (value receiver).

Returns

This call does not return a value.

(T) failed

XuAPI
pub fn (t T) failed() bool

Purpose

Execute failed on T.

Parameters

t T
The T instance used by this call (value receiver).

Returns

bool — true or false

(T) skipped

XuAPI
pub fn (t T) skipped() bool

Purpose

Execute skipped on T.

Parameters

t T
The T instance used by this call (value receiver).

Returns

bool — true or false

($&T) log

XuAPI
pub fn (t $&T) log(msg &string)

Purpose

Operation on $&T: natural logarithm.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
msg &string
message (read-only borrow; caller keeps the original; type &string)

Returns

This call does not return a value.

($&T) logf

XuAPI
pub fn (t $&T) logf(f string, args <-> fmt.Arg)

Purpose

Execute logf on $&T.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
f string
callback or format string (string)
args <-> fmt.Arg
variadic fmt.Arg (seen inside the function as []fmt.Arg)

Returns

This call does not return a value.

($&T) fail

XuAPI
pub fn (t $&T) fail()

Purpose

Execute fail on $&T.

Parameters

t $&T
The T instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&T) error

XuAPI
pub fn (t $&T) error(msg &string)

Purpose

Execute error on $&T.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
msg &string
message (read-only borrow; caller keeps the original; type &string)

Returns

This call does not return a value.

($&T) errorf

XuAPI
pub fn (t $&T) errorf(f string, args <-> fmt.Arg)

Purpose

Operation on $&T: build an error from a format string.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
f string
callback or format string (string)
args <-> fmt.Arg
variadic fmt.Arg (seen inside the function as []fmt.Arg)

Returns

This call does not return a value.

($&T) fail_now

XuAPI
pub fn (t $&T) fail_now()

Purpose

Operation on $&T: fail now.

Parameters

t $&T
The T instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&T) fatal

XuAPI
pub fn (t $&T) fatal(msg &string)

Purpose

Execute fatal on $&T.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
msg &string
message (read-only borrow; caller keeps the original; type &string)

Returns

This call does not return a value.

($&T) fatalf

XuAPI
pub fn (t $&T) fatalf(f string, args <-> fmt.Arg)

Purpose

Execute fatalf on $&T.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
f string
callback or format string (string)
args <-> fmt.Arg
variadic fmt.Arg (seen inside the function as []fmt.Arg)

Returns

This call does not return a value.

($&T) skip_now

XuAPI
pub fn (t $&T) skip_now()

Purpose

Operation on $&T: skip now.

Parameters

t $&T
The T instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&T) skip

XuAPI
pub fn (t $&T) skip(msg &string)

Purpose

Execute skip on $&T.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
msg &string
message (read-only borrow; caller keeps the original; type &string)

Returns

This call does not return a value.

($&T) skipf

XuAPI
pub fn (t $&T) skipf(f string, args <-> fmt.Arg)

Purpose

Execute skipf on $&T.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
f string
callback or format string (string)
args <-> fmt.Arg
variadic fmt.Arg (seen inside the function as []fmt.Arg)

Returns

This call does not return a value.

($&T) cleanup

XuAPI
pub fn (t $&T) cleanup(f fn())

Purpose

Execute cleanup on $&T.

Parameters

t $&T
The T instance used by this call (exclusive borrow).
f fn()
Callback with signature fn(); pass the function value for this operation to invoke.

Returns

This call does not return a value.

($&T) run_cleanup

XuAPI
pub fn (t $&T) run_cleanup()

Purpose

LIFO. The language test harness does not call this; tests must invoke it.

Parameters

t $&T
The T instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(T) run

XuAPI
pub fn (t T) run(name string) T

Purpose

Execute run on T.

Parameters

t T
The T instance used by this call (value receiver).
name string
name (string)

Returns

T — a value of this type

short

XuAPI
pub fn short() bool

Purpose

Execute short.

Parameters

No arguments are required.

Returns

bool — true or false

struct B

XuAPI
pub struct B {
    pub n int
    pub failed int
    pub name string
}

Purpose

Structure encapsulating n, failed, name.

Public fields

n int
count, length, or limit
failed int
field (int)
name string
name

b

XuAPI
pub fn b(n int) B

Purpose

Execute b.

Parameters

n int
count, length, or limit (int)

Returns

B — a value of this type

($&B) fail

XuAPI
pub fn (b $&B) fail()

Purpose

Execute fail on $&B.

Parameters

b $&B
The B instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&B) errorf

XuAPI
pub fn (b $&B) errorf(f string, args <-> fmt.Arg)

Purpose

Operation on $&B: build an error from a format string.

Parameters

b $&B
The B instance used by this call (exclusive borrow).
f string
callback or format string (string)
args <-> fmt.Arg
variadic fmt.Arg (seen inside the function as []fmt.Arg)

Returns

This call does not return a value.

($&B) fatalf

XuAPI
pub fn (b $&B) fatalf(f string, args <-> fmt.Arg)

Purpose

Execute fatalf on $&B.

Parameters

b $&B
The B instance used by this call (exclusive borrow).
f string
callback or format string (string)
args <-> fmt.Arg
variadic fmt.Arg (seen inside the function as []fmt.Arg)

Returns

This call does not return a value.

(B) failed

XuAPI
pub fn (b B) failed() bool

Purpose

Execute failed on B.

Parameters

b B
The B instance used by this call (value receiver).

Returns

bool — true or false