pub struct Test<D = ()> {
    pub name: String,
    pub kind: String,
    pub is_ignored: bool,
    pub is_bench: bool,
    pub data: D,
}
Expand description

Description of a single test.

Fields

name: String

The name of the test. It’s displayed in the output and used for all kinds of filtering.

kind: String

Optional string to describe the kind of test. If this string is not empty, it is printed in brackets before the test name (e.g. test [my-kind] test_name).

is_ignored: bool

Whether or not this test should be ignored. If the --ignored flag is set, ignored tests are executed, too.

is_bench: bool

Whether this test is actually a benchmark.

data: D

Custom data. This field is not used by this library and can instead be used to store arbitrary data per test.

Implementations

Creates a test with the given name, an empty kind and default data. The test is not ignored and is not a benchmark.

Creates a benchmark with the given name, an empty kind and default data. The benchmark is not ignored.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.