MCPcopy Index your code
hub / github.com/endbasic/endbasic / expect_program

Method expect_program

std/src/testutils.rs:973–984  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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 {

Callers 15

test_disasm_okFunction · 0.80
test_disasm_pagingFunction · 0.80
test_disasm_code_errorsFunction · 0.80
test_edit_okFunction · 0.80
test_list_okFunction · 0.80
test_list_pagingFunction · 0.80
test_load_okFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected