Skip to content

Commit 061a989

Browse files
author
José Valim
committed
Move DebugInfo test into its own sync case
1 parent 21f10f7 commit 061a989

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

lib/elixir/test/elixir/protocol_test.exs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,6 @@ defmodule ProtocolTest do
160160
assert WithAny.__info__(:attributes)[:protocol] == [fallback_to_any: true]
161161
end
162162

163-
test "protocols always keep debug_info" do
164-
Code.compiler_options(debug_info: false)
165-
166-
{:module, _, binary, _} =
167-
defprotocol DebugInfoProto do
168-
end
169-
170-
assert {:ok, {DebugInfoProto, [debug_info: debug_info]}} =
171-
:beam_lib.chunks(binary, [:debug_info])
172-
173-
assert {:debug_info_v1, :elixir_erl, {:elixir_v1, _, _}} = debug_info
174-
after
175-
Code.compiler_options(debug_info: true)
176-
end
177-
178163
test "defimpl" do
179164
module = Module.concat(Sample, ImplStruct)
180165
assert module.__impl__(:for) == ImplStruct
@@ -275,6 +260,25 @@ defmodule ProtocolTest do
275260
end
276261
end
277262

263+
defmodule Protocol.DebugInfoTest do
264+
use ExUnit.Case
265+
266+
test "protocols always keep debug_info" do
267+
Code.compiler_options(debug_info: false)
268+
269+
{:module, _, binary, _} =
270+
defprotocol DebugInfoProto do
271+
end
272+
273+
assert {:ok, {DebugInfoProto, [debug_info: debug_info]}} =
274+
:beam_lib.chunks(binary, [:debug_info])
275+
276+
assert {:debug_info_v1, :elixir_erl, {:elixir_v1, _, _}} = debug_info
277+
after
278+
Code.compiler_options(debug_info: true)
279+
end
280+
end
281+
278282
path = Path.expand("../ebin", __DIR__)
279283
File.mkdir_p!(path)
280284

0 commit comments

Comments
 (0)