Struct endbasic_std::testutils::Tester [−][src]
Builder pattern to prepare an EndBASIC machine for testing purposes.
Implementations
impl Tester
[src]
pub fn from(machine: Machine) -> Self
[src]
Creates a new tester using the given Machine
.
pub fn add_command(self, command: Rc<dyn Command>) -> Self
[src]
Registers the given builtin command into the machine, which must not yet be registered.
pub fn add_function(self, function: Rc<dyn Function>) -> Self
[src]
Registers the given builtin function into the machine, which must not yet be registered.
pub fn add_input_chars(self, golden_in: &str) -> Self
[src]
Adds the golden_in
characters as console input.
pub fn get_machine(&mut self) -> &mut Machine
[src]
Returns a mutable reference to the machine inside the tester.
This method should generally not be used, except to run native methods that have side-effects on the machine that we'd like to validate later.
pub fn get_console(&self) -> Rc<RefCell<MockConsole>>
[src]
Gets the mock console from the tester.
This method should generally not be used. Its primary utility is to hook externally-instantiated commands into the testing features.
pub fn get_store(&self) -> Rc<RefCell<InMemoryStore>>
[src]
Gets the in-memory store from the tester.
This method should generally not be used. Its primary utility is to hook externally-instantiated commands into the testing features.
pub fn get_program(&self) -> Rc<RefCell<RecordedProgram>>
[src]
Gets the recorded program from the tester.
This method should generally not be used. Its primary utility is to hook externally-instantiated commands into the testing features.
pub fn set_program(self, text: &str) -> Self
[src]
Sets the initial contents of the recorded program to text
. Can only be called once and
text
must not be empty.
pub fn write_file(self, name: &str, content: &str) -> Self
[src]
Creates or overwrites a file in the store.
pub fn run<S: Into<String>>(&mut self, script: S) -> Checker<'_>
[src]
Runs script
in the configured machine and returns a Checker
object to validate
expectations about the execution.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Tester
[src]
impl !Send for Tester
[src]
impl !Sync for Tester
[src]
impl Unpin for Tester
[src]
impl !UnwindSafe for Tester
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,