test "2_int_inc" do
assert parse_file("test_data/2_int_inc.opt.wasm")
|> Enum.filter(fn {k, _} -> k == :section_type or k == :section_body end) ==
[
{:section_type, :type},
{:section_body, [{[:i32], [:i32]}]},
{:section_type, :function},
{:section_body, [0]},
{:section_type, :memory},
{:section_body, [{2, nil}]},
{:section_type, :global},
{:section_body,
[{{:i32, :const}, ["i32.const": 66560]}, {{:i32, :const}, ["i32.const": 1024]}]},
{:section_type, :export},
{:section_body,
[
{"memory", {:mem, 0}},
{"__heap_base", {:global, 0}},
{"__data_end", {:global, 1}},
{"inc", {:func, 0}}
]},
{:section_type, :code},
{:section_body,
[
%{
code: %{
expr: [
{:"local.get", 0},
{:"i32.const", 1},
:"i32.add"
],
locals: []
},
size: 7
}
]}
]
end