Skip to content

Commit 2297fc1

Browse files
committed
Improve Binary.Inspect for Function test
1 parent 2e10c3d commit 2297fc1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/elixir/test/elixir/binary/inspect_test.exs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ end
188188
defmodule Binary.Inspect.FunctionTest do
189189
use ExUnit.Case, async: true
190190

191+
def f do
192+
fn() -> :ok end
193+
end
194+
191195
test :funs do
192196
bin = inspect(fn(x) -> x + 1 end)
193197
assert '#Fun<' ++ _ = binary_to_list(bin)
@@ -198,6 +202,11 @@ defmodule Binary.Inspect.FunctionTest do
198202
assert bin == "function(Enum.map/2)"
199203
end
200204

205+
test :external_elixir_fun do
206+
bin = inspect(f)
207+
assert '#Fun<' ++ _ = binary_to_list(bin)
208+
end
209+
201210
test :external_erlang do
202211
bin = inspect(function(:lists.map/2))
203212
assert bin == "function(:lists.map/2)"

0 commit comments

Comments
 (0)