Skip to content

Commit

Permalink
Purge modules between tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Jun 5, 2024
1 parent f712557 commit d6e6924
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/elixir/test/elixir/kernel/parallel_compiler_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,18 @@ defmodule Kernel.ParallelCompilerTest do
write_tmp(
"error_line",
a: """
defmodule A do
defmodule PCA do
def fun(arg), do: arg / 2
end
""",
b: """
defmodule B do
defmodule PCB do
def fun(arg) do
A.fun(arg)
PCA.fun(arg)
:ok
end
end
B.fun(:not_a_number)
PCB.fun(:not_a_number)
"""
)

Expand Down
7 changes: 6 additions & 1 deletion lib/elixir/test/elixir/typespec_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ defmodule TypespecTest do

assert_raise Kernel.TypespecError, ~r"invalid binary specification", fn ->
test_module do
@type my_type :: <<_::atom>>
@type my_type :: <<_::atom()>>
end
end

Expand Down Expand Up @@ -1343,6 +1343,11 @@ defmodule TypespecTest do
assert Code.Typespec.spec_to_quoted(:union_struct_key_type, ast_union_struct_key_type)
|> Macro.to_string() ==
"union_struct_key_type(%{__struct__: atom() | TypespecTest.A | binary()}) :: :ok"
after
for mod <- [A, B] do
:code.purge(mod)
:code.delete(mod)
end
end

test "non-variables are given as arguments" do
Expand Down

0 comments on commit d6e6924

Please sign in to comment.