Skip to main content

Test

Trait Test 

Source
pub trait Test: Send + Sync {
    // Required methods
    fn symbol(&self) -> Symbol;
    fn lib(&self) -> Symbol;
    fn describe(&self, cx: &mut Cx) -> Result<Value>;
    fn run(&self, cx: &mut Cx) -> Result<TestReport>;
}
Expand description

A library-supplied test the registry can hold and run.

The kernel defines the contract; the test body is library behavior.

Required Methods§

Source

fn symbol(&self) -> Symbol

Symbol naming this test.

Source

fn lib(&self) -> Symbol

Symbol of the library that owns this test.

Source

fn describe(&self, cx: &mut Cx) -> Result<Value>

Produces a value describing this test without running it.

Source

fn run(&self, cx: &mut Cx) -> Result<TestReport>

Runs the test and returns its TestReport.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§