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

Method expect_array_simple

std/src/testutils.rs:914–931  ·  view source on GitHub ↗

Adds the `name` array as an array to expect in the final state of the machine. The array will be tested to have the same `subtype` and only one dimension with `contents`.

(
        mut self,
        name: S,
        subtype: ExprType,
        contents: Vec<ConstantDatum>,
    )

Source from the content-addressed store, hash-verified

912 /// Adds the `name` array as an array to expect in the final state of the machine. The array
913 /// will be tested to have the same `subtype` and only one dimension with `contents`.
914 pub fn expect_array_simple<S: AsRef<str>>(
915 mut self,
916 name: S,
917 subtype: ExprType,
918 contents: Vec<ConstantDatum>,
919 ) -> Self {
920 let key = SymbolKey::from(name);
921 assert!(!self.exp_arrays.contains_key(&key));
922 let mut exp_array = Vec::with_capacity(contents.len());
923 for (i, value) in contents.into_iter().enumerate() {
924 exp_array.push((vec![i as i32], value));
925 }
926 self.exp_arrays.insert(
927 key,
928 ExpArray { subtype, dimensions: vec![exp_array.len()], contents: exp_array },
929 );
930 self
931 }
932
933 /// Adds tracking for all the side-effects of a clear operation on the machine.
934 pub fn expect_clear(mut self) -> Self {

Callers 2

test_bound_integrationFunction · 0.80

Calls 4

pushMethod · 0.80
lenMethod · 0.45
enumerateMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected