MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / compare_results

Method compare_results

cranelift/reader/src/run_command.rs:52–67  ·  view source on GitHub ↗
(
        compare: &Comparison,
        actual: &Vec<DataValue>,
        expected: &Vec<DataValue>,
    )

Source from the content-addressed store, hash-verified

50 }
51
52 fn compare_results(
53 compare: &Comparison,
54 actual: &Vec<DataValue>,
55 expected: &Vec<DataValue>,
56 ) -> bool {
57 let are_equal = actual.len() == expected.len()
58 && actual
59 .into_iter()
60 .zip(expected)
61 .all(|(a, b)| a.bitwise_eq(b));
62
63 match compare {
64 Comparison::Equals => are_equal,
65 Comparison::NotEquals => !are_equal,
66 }
67 }
68}
69
70impl Display for RunCommand {

Callers

nothing calls this directly

Calls 4

bitwise_eqMethod · 0.80
lenMethod · 0.45
allMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected