Skip to main content

Register

Struct Register 

Source
pub struct Register { /* private fields */ }
Expand description

A fixture of recorded divergences, run by every port.

Each row gives an input and one cell per runtime, written in the same vocabulary as an ordinary fixture’s expected column: a JSON value, or ERROR:<code>. Every row is checked three ways:

  1. The row must actually record a divergence. If every runtime cell says the same thing, the row asserts nothing and would pass forever; that is the shape of the claims this mechanism replaces.
  2. This runtime must still produce what the register says it does.
  3. When it does not, and it now produces what ANOTHER runtime’s cell says, the failure says the divergence is CLOSED and names the row to delete, rather than reporting it as a regression, which is the opposite conclusion.

Implementations§

Source§

impl Register

Source

pub fn new(runner: Runner, runtime: &str, runtimes: &[&str]) -> Self

A register reading the runtime column of a file whose runtime columns are runtimes.

Source

pub fn check_row(&self, row: &Row, input: &str) -> Result<()>

Run one row and return the failure rather than reporting it.

Source

pub fn run_spec(&self, spec: &SpecFile) -> Result<Vec<String>>

Run every row of an already-loaded register. Err when it cannot run at all; otherwise the failures, one per failing row.

Source

pub fn run_file(&self, path: impl AsRef<Path>) -> Result<Vec<String>>

Load one register file by path and run it; see Register::run_spec.

Source

pub fn spec(&self, spec: &SpecFile)

Run an already-loaded register, panicking with every failing row.

Source

pub fn file(&self, path: impl AsRef<Path>)

Load one register file by path and run it, panicking on failure.

Trait Implementations§

Source§

impl Clone for Register

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Register

§

impl !Send for Register

§

impl !Sync for Register

§

impl !UnwindSafe for Register

§

impl Forget for Register

§

impl Freeze for Register
where *const RcInner<dyn Fn(&str, &Row) -> Result<Value, Failure>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&str, &Row) -> Result<Value, Failure>>>: Freeze, *const RcInner<dyn Fn(&Failure, &str, &Row) -> bool> is !null: Freeze, PhantomData<RcInner<dyn Fn(&Failure, &str, &Row) -> bool>>: Freeze, *const RcInner<dyn Fn(&str, &Row) -> Result<Value, Error>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&str, &Row) -> Result<Value, Error>>>: Freeze, *const RcInner<dyn Fn(Value) -> Value> is !null: Freeze, PhantomData<RcInner<dyn Fn(Value) -> Value>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze,

§

impl Move for Register

§

impl Unpin for Register
where Rc<dyn Fn(&str, &Row) -> Result<Value, Failure>>: Unpin, Rc<dyn Fn(&Failure, &str, &Row) -> bool>: Unpin, Rc<dyn Fn(&str, &Row) -> Result<Value, Error>>: Unpin, Rc<dyn Fn(Value) -> Value>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Register
where *const RcInner<dyn Fn(&str, &Row) -> Result<Value, Failure>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&str, &Row) -> Result<Value, Failure>>>: UnsafeUnpin, *const RcInner<dyn Fn(&Failure, &str, &Row) -> bool> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&Failure, &str, &Row) -> bool>>: UnsafeUnpin, *const RcInner<dyn Fn(&str, &Row) -> Result<Value, Error>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&str, &Row) -> Result<Value, Error>>>: UnsafeUnpin, *const RcInner<dyn Fn(Value) -> Value> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(Value) -> Value>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.