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

Method expect_array

std/src/testutils.rs:898–910  ·  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 `dimensions`, as well as specific `contents`. The contents are provided as a collection of subscripts/value pairs to assign to the expected array.

(
        mut self,
        name: S,
        subtype: ExprType,
        dimensions: &[usize],
        contents: Vec<(Vec<i32>, ConstantDatum)>,
    )

Source from the content-addressed store, hash-verified

896 /// The contents are provided as a collection of subscripts/value pairs to assign to the
897 /// expected array.
898 pub fn expect_array<S: AsRef<str>>(
899 mut self,
900 name: S,
901 subtype: ExprType,
902 dimensions: &[usize],
903 contents: Vec<(Vec<i32>, ConstantDatum)>,
904 ) -> Self {
905 let key = SymbolKey::from(name);
906 assert!(!self.exp_arrays.contains_key(&key));
907 self.exp_arrays
908 .insert(key, ExpArray { subtype, dimensions: dimensions.to_vec(), contents });
909 self
910 }
911
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`.

Callers 4

do_bound_errors_testFunction · 0.80
test_lbound_okFunction · 0.80
test_ubound_okFunction · 0.80
test_help_errorsFunction · 0.80

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected