refactor binary encoding to its own package (#1187)

move binary encoder to its own package

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
This commit is contained in:
Edoardo Vacchi
2023-03-03 00:21:22 +01:00
committed by GitHub
parent e2660b3f17
commit 117474c477
56 changed files with 1042 additions and 608 deletions

View File

@@ -9,9 +9,9 @@ import (
"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/api"
"github.com/tetratelabs/wazero/internal/platform"
"github.com/tetratelabs/wazero/internal/testing/binaryencoding"
"github.com/tetratelabs/wazero/internal/testing/require"
"github.com/tetratelabs/wazero/internal/wasm"
"github.com/tetratelabs/wazero/internal/wasm/binary"
)
var ctx = context.Background()
@@ -354,7 +354,7 @@ func Test888(t *testing.T) {
// This tests that importing FuncRef type globals and using it as an initialization of the locally-defined
// FuncRef global works fine.
run(t, func(t *testing.T, r wazero.Runtime) {
imported := binary.EncodeModule(&wasm.Module{
imported := binaryencoding.EncodeModule(&wasm.Module{
MemorySection: &wasm.Memory{Min: 0, Max: 5, IsMaxEncoded: true},
GlobalSection: []*wasm.Global{
{