@@ -160,21 +160,6 @@ defmodule ProtocolTest do
160
160
assert WithAny . __info__ ( :attributes ) [ :protocol ] == [ fallback_to_any: true ]
161
161
end
162
162
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
-
178
163
test "defimpl" do
179
164
module = Module . concat ( Sample , ImplStruct )
180
165
assert module . __impl__ ( :for ) == ImplStruct
@@ -275,6 +260,25 @@ defmodule ProtocolTest do
275
260
end
276
261
end
277
262
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
+
278
282
path = Path . expand ( "../ebin" , __DIR__ )
279
283
File . mkdir_p! ( path )
280
284
0 commit comments