Skip to content

Commit a0e061f

Browse files
committed
Fix warnings during suite
1 parent 17448e7 commit a0e061f

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

lib/elixir/test/elixir/inspect_test.exs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ defmodule Inspect.MapTest do
591591

592592
{my_argument_error, stacktrace} =
593593
try do
594-
Atom.to_string(failing.name)
594+
atom_to_string(failing.name)
595595
rescue
596596
e ->
597597
{e, __STACKTRACE__}
@@ -610,6 +610,10 @@ defmodule Inspect.MapTest do
610610
assert inspected =~ message
611611
end
612612

613+
defp atom_to_string(atom) do
614+
Atom.to_string(atom)
615+
end
616+
613617
test "exception" do
614618
assert inspect(%RuntimeError{message: "runtime error"}) ==
615619
"%RuntimeError{message: \"runtime error\"}"

lib/elixir/test/elixir/kernel/diagnostics_test.exs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ defmodule Kernel.DiagnosticsTest do
55

66
import ExUnit.CaptureIO
77

8-
setup do
8+
setup_all do
9+
previous = Application.get_env(:elixir, :ansi_enabled, false)
910
Application.put_env(:elixir, :ansi_enabled, false)
10-
on_exit(fn -> Application.put_env(:elixir, :ansi_enabled, true) end)
11+
on_exit(fn -> Application.put_env(:elixir, :ansi_enabled, previous) end)
1112
end
1213

1314
describe "mismatched delimiter" do

lib/elixir/test/elixir/test_helper.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ File.rm_rf!(path)
44
File.mkdir_p!(path)
55
Code.prepend_path(path)
66

7+
Application.put_env(:elixir, :ansi_enabled, true)
78
Code.compiler_options(debug_info: true)
89

910
defmodule PathHelpers do

lib/elixir/test/elixir/tuple_test.exs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ defmodule TupleTest do
4949
assert mod.insert_at({:bar, :baz}, 0, :foo) == {:foo, :bar, :baz}
5050
end
5151

52-
test "append/2" do
53-
assert Tuple.append({:foo, :bar}, :baz) == {:foo, :bar, :baz}
54-
55-
mod = Tuple
56-
assert mod.append({:foo, :bar}, :baz) == {:foo, :bar, :baz}
57-
end
58-
5952
test "delete_at/2" do
6053
assert Tuple.delete_at({:foo, :bar, :baz}, 0) == {:bar, :baz}
6154

lib/ex_unit/test/ex_unit/formatter_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,13 @@ defmodule ExUnit.FormatterTest do
514514
end
515515

516516
test "inspect failure" do
517-
failure = [{:error, catch_assertion(assert :will_fail == %BadInspect{}), []}]
517+
failure = [{:error, catch_assertion(assert :will_fail == struct!(BadInspect)), []}]
518518

519519
assert format_test_failure(test(), failure, 1, 80, &formatter/2) =~ ~s'''
520520
1) world (Hello)
521521
test/ex_unit/formatter_test.exs:1
522522
Assertion with == failed
523-
code: assert :will_fail == %BadInspect{}
523+
code: assert :will_fail == struct!(BadInspect)
524524
left: :will_fail
525525
right: #Inspect.Error<
526526
got FunctionClauseError with message:

0 commit comments

Comments
 (0)