Runs `scripts` in the configured machine and returns a `Checker` object to validate expectations about the execution. The first entry in `scripts` to fail aborts execution and allows checking the result of that specific invocation. This is useful when compared to `run` because `Machine::exec` compiles the script as one unit and thus compilation errors may prevent validating other operations late
(&mut self, scripts: &[&str])
| 756 | /// This is useful when compared to `run` because `Machine::exec` compiles the script as one |
| 757 | /// unit and thus compilation errors may prevent validating other operations later on. |
| 758 | pub fn run_n(&mut self, scripts: &[&str]) -> Checker<'_> { |
| 759 | let mut machine = self.build_machine(); |
| 760 | let mut result = Ok(None); |
| 761 | for script in scripts { |
| 762 | match machine.compile(&mut script.as_bytes()) { |
| 763 | Ok(()) => (), |
| 764 | Err(e) => { |
| 765 | result = Err(format!("{}", e)); |
| 766 | break; |
| 767 | } |
| 768 | } |
| 769 | result = block_on(machine.exec()).map_err(|e| format!("{}", e)); |
| 770 | if result.is_err() { |
| 771 | break; |
| 772 | } |
| 773 | } |
| 774 | Checker::new(self, machine, result) |
| 775 | } |
| 776 | } |
| 777 | |
| 778 | /// A tester that allows continuing a previous check. |
no test coverage detected