fn can_validate_invalid_offset_expression_in_data_section() {
    let wasm = wat2wasm(
        r#"
                (module
                    (global (;0;) (import "test" "test") i32)
                    (memory (;0;) 1)
                    (data (global.get 0) "abcd")
                )
            "#,
    )
    .unwrap();
    assert_matches!(
        validate_wasm_binary(&wasm, &EmbeddersConfig::default()),
        Err(WasmValidationError::InvalidImportSection(_))
    );
}
// this test passes currently not because of a correct validation that we're not
// using a global in data offset expression, but because we terminate the
// validation on rejecting an imported global.
this test passes currently not because of a correct validation that we're not
using a global in data offset expression, but because we terminate the
validation on rejecting an imported global.
this test passes currently not because of a correct validation that we ' re not using a global in data offset expression but because we terminate the validation on rejecting an imported global .
fn can_validate_invalid_offset_expression_in_data_section() {
    let wasm = wat2wasm(
        r#"
                (module
                    (global (;0;) (import "test" "test") i32)
                    (memory (;0;) 1)
                    (data (global.get 0) "abcd")
                )
            "#,
    )
    .unwrap();
    assert_matches!(
        validate_wasm_binary(&wasm, &EmbeddersConfig::default()),
        Err(WasmValidationError::InvalidImportSection(_))
    );
}
fn can_validate_invalid_offset_expression_in_data_section ( ) { let wasm = wat2wasm ( r#"
                (module
                    (global (;0;) (import "test" "test") i32)
                    (memory (;0;) 1)
                    (data (global.get 0) "abcd")
                )
            "# , ) . unwrap ( ) ; assert_matches ! ( validate_wasm_binary ( wasm EmbeddersConfig default ( ) ) Err ( WasmValidationError InvalidImportSection ( ) ) ) ; }
this test passes currently not because of a correct validation that we're not
using a global in data offset expression, but because we terminate the
validation on rejecting an imported global.
this test passes currently not because of a correct validation that we ' re not using a global in data offset expression but because we terminate the validation on rejecting an imported global .