diff --git a/test/examples/arena.exs b/test/examples/arena.exs index f2f619c..ccb0826 100644 --- a/test/examples/arena.exs +++ b/test/examples/arena.exs @@ -11,8 +11,10 @@ defmodule Examples.Arena do require Orb.Memory page_offset = Orb.Memory.pages(unquote(opts[:pages])) + module_name = Module.concat(__MODULE__, unquote(name)) + offset_global_name = - String.to_atom("#{Macro.inspect_atom(:literal, unquote(name))}.bump_offset") + String.to_atom("#{Macro.inspect_atom(:literal, module_name)}.bump_offset") global( do: [ @@ -33,8 +35,6 @@ defmodule Examples.Arena do # end # end - module_name = Module.concat(__MODULE__, unquote(name)) - Module.create(module_name, quote do use Orb diff --git a/test/examples/arena_test.exs b/test/examples/arena_test.exs index 431db6d..6a9dd33 100644 --- a/test/examples/arena_test.exs +++ b/test/examples/arena_test.exs @@ -15,7 +15,7 @@ defmodule Examples.ArenaTest do Orb.include(A.First) - defw test() do + defw test(), I32 do A.First.alloc(16) end end @@ -24,12 +24,12 @@ defmodule Examples.ArenaTest do assert ~S""" (module $A (memory (export "memory") 5) - (global $First.bump_offset (mut i32) (i32.const 0)) - (global $Second.bump_offset (mut i32) (i32.const 131072)) + (global $Examples.ArenaTest.A.First.bump_offset (mut i32) (i32.const 0)) + (global $Examples.ArenaTest.A.Second.bump_offset (mut i32) (i32.const 131072)) (func $Examples.ArenaTest.A.First.alloc (param $byte_count i32) (result i32) (i32.const 0) ) - (func $test (export "test") + (func $test (export "test") (result i32) (call $Examples.ArenaTest.A.First.alloc (i32.const 16)) ) )