Struct TestEngine

Source
pub struct TestEngine<I: AsRef<Path>, O: AsRef<Path>> { /* private fields */ }
Expand description

Facilitates the execution of problem solving code.

Implementations§

Source§

impl<I: AsRef<Path>, O: AsRef<Path>> TestEngine<I, O>

Source

pub fn new(input_file_path: I, output_file_path: O) -> TestEngine<I, O>

Creates a new test engine using the specified input and output file paths.

Calling this method is cheap; no files are opened until TestEngine::run() is called.

Source

pub fn run<D: Sized + Send + Sync, R: Display + Sized + Send, P: Fn(&mut InputReader) -> D, S: Fn(&D) -> R + Sync>( self, p: P, s: S, )

Consumes the test engine, executing a parser and solver once per test case.

§Panics

This method panics in the event of an I/O error.

Source§

impl TestEngine<OsString, OsString>

Source

pub fn from_args() -> TestEngine<OsString, OsString>

Creates a new test engine using input and output file paths obtained from command line arguments.

Calling this method is cheap; no files are opened until TestEngine::run() is called.

§Panics

This method panics if either the input file path or output file path is missing.

Trait Implementations§

Source§

impl<I: Debug + AsRef<Path>, O: Debug + AsRef<Path>> Debug for TestEngine<I, O>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TestEngine<OsString, OsString>

Source§

fn default() -> TestEngine<OsString, OsString>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<I, O> Freeze for TestEngine<I, O>
where I: Freeze, O: Freeze,

§

impl<I, O> RefUnwindSafe for TestEngine<I, O>

§

impl<I, O> Send for TestEngine<I, O>
where I: Send, O: Send,

§

impl<I, O> Sync for TestEngine<I, O>
where I: Sync, O: Sync,

§

impl<I, O> Unpin for TestEngine<I, O>
where I: Unpin, O: Unpin,

§

impl<I, O> UnwindSafe for TestEngine<I, O>
where I: UnwindSafe, O: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.