Sets the expected name of the stored program to `name` and its contents to `text`. Can only be called once and `text` must not be empty.
(
mut self,
name: Option<S1>,
text: S2,
)
| 971 | /// Sets the expected name of the stored program to `name` and its contents to `text`. Can only |
| 972 | /// be called once and `text` must not be empty. |
| 973 | pub fn expect_program<S1: Into<String>, S2: Into<String>>( |
| 974 | mut self, |
| 975 | name: Option<S1>, |
| 976 | text: S2, |
| 977 | ) -> Self { |
| 978 | assert!(self.exp_program_text.is_empty()); |
| 979 | let text = text.into(); |
| 980 | assert!(!text.is_empty()); |
| 981 | self.exp_program_name = name.map(|x| x.into()); |
| 982 | self.exp_program_text = text; |
| 983 | self |
| 984 | } |
| 985 | |
| 986 | /// Adds the `name`/`value` pair as a variable to expect in the final state of the machine. |
| 987 | pub fn expect_var<S: AsRef<str>, V: Into<ConstantDatum>>(mut self, name: S, value: V) -> Self { |
no outgoing calls
no test coverage detected