fn inject_and_cmp(testname: &str, conf: &InstructionCostTable) {
    let filename = format!(
        "{}/tests/instrumentation-test-data/{}.wat",
        std::env::var("CARGO_MANIFEST_DIR").unwrap(),
        testname
    );
    let content = fs::read_to_string(filename).expect("couldn't read the input file");
    let mut features = Features::new();
    features.enable_bulk_memory();
    let buff = wabt::wat2wasm_with_features(content, features.clone())
        .expect("couldn't convert the input wat to Wasm");
    let output =
        instrument(&BinaryEncodedWasm::new(buff), conf).expect("couldn't instrument Wasm code");
    let module: Module = parity_wasm::elements::deserialize_buffer(output.binary.as_slice())
        .expect("couldn't deserialize module");
    let out = wabt::wasm2wat_with_features(
        elements::serialize(module).expect("couldn't serialize after metering"),
        features,
    )
    .expect("couldn't convert metered Wasm to wat");
    assert_snapshot!(out);
}
/// Assert what the output of wasm instrumentation should be using the [`insta`]
/// crate.
///
/// When making changes that alter the expected output, changes can be easily reviewed and acked using the [`insta` cli](https://insta.rs/docs/cli/).
/// Expected output is stored in `.snap` files in the `snapshots` folder.
/// When tests fail, the new output will be stored in a `.snap.new` file.
/// Instead of using the `insta` cli, you can review and make changes by
/// directly diffing the `.snap` and `.snap.new` files and save changes by
/// updating the `.snap` file.
Assert what the output of wasm instrumentation should be using the [`insta`]
crate.

When making changes that alter the expected output, changes can be easily reviewed and acked using the [`insta` cli].
Expected output is stored in `.snap` files in the `snapshots` folder.
When tests fail, the new output will be stored in a `.snap.new` file.
Assert what the output of wasm instrumentation should be using the [ ` insta ` ] crate . When making changes that alter the expected output changes can be easily reviewed and acked using the [ ` insta ` cli ] . Expected output is stored in ` . snap ` files in the ` snapshots ` folder . When tests fail the new output will be stored in a ` . snap . new ` file .
fn inject_and_cmp(testname: &str, conf: &InstructionCostTable) {
    let filename = format!(
        "{}/tests/instrumentation-test-data/{}.wat",
        std::env::var("CARGO_MANIFEST_DIR").unwrap(),
        testname
    );
    let content = fs::read_to_string(filename).expect("couldn't read the input file");
    let mut features = Features::new();
    features.enable_bulk_memory();
    let buff = wabt::wat2wasm_with_features(content, features.clone())
        .expect("couldn't convert the input wat to Wasm");
    let output =
        instrument(&BinaryEncodedWasm::new(buff), conf).expect("couldn't instrument Wasm code");
    let module: Module = parity_wasm::elements::deserialize_buffer(output.binary.as_slice())
        .expect("couldn't deserialize module");
    let out = wabt::wasm2wat_with_features(
        elements::serialize(module).expect("couldn't serialize after metering"),
        features,
    )
    .expect("couldn't convert metered Wasm to wat");
    assert_snapshot!(out);
}
fn inject_and_cmp ( testname : & str , conf : & InstructionCostTable ) { let filename = format ! ( " " std env var ( " " ) unwrap ( ) testname ) ; let content = fs :: read_to_string ( filename ) . expect ( " " ) ; let mut features = Features :: new ( ) ; features . enable_bulk_memory ( ) ; let buff = wabt :: wat2wasm_with_features ( content , features . clone ( ) ) . expect ( " " ) ; let output = instrument ( & BinaryEncodedWasm :: new ( buff ) , conf ) . expect ( " " ) ; let module : Module = parity_wasm :: elements :: deserialize_buffer ( output . binary . as_slice ( ) ) . expect ( " " ) ; let out = wabt :: wasm2wat_with_features ( elements :: serialize ( module ) . expect ( " " ) , features , ) . expect ( " " ) ; assert_snapshot ! ( out ) ; }
Assert what the output of wasm instrumentation should be using the [`insta`]
crate.
Assert what the output of wasm instrumentation should be using the [ ` insta ` ] crate .
testname
&str
conf
&InstructionCostTable
testname
&str
conf
&InstructionCostTable