Skip to content

Commit c08b5b1

Browse files
author
José Valim
committed
Move tests to Erlang 18 which has proper logger behaviour
Signed-off-by: José Valim <[email protected]>
1 parent 8939b39 commit c08b5b1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/logger/test/logger/error_handler_test.exs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ defmodule Logger.ErrorHandlerTest do
3939
assert error_log(:error_report, :special, :hello) == ""
4040
end
4141

42-
test "formats error_logger warning message" do
43-
# Warnings by default are logged as errors by Erlang
44-
assert error_log(:warning_msg, "hello", []) =~ msg("[error] hello")
45-
assert error_log(:warning_msg, "~p~n", [:hello]) =~ msg("[error] :hello")
46-
end
42+
if :erlang.system_info(:otp_release) >= '18' do
43+
test "formats error_logger warning message" do
44+
assert error_log(:warning_msg, "hello", []) =~ msg("[warn] hello")
45+
assert error_log(:warning_msg, "~p~n", [:hello]) =~ msg("[warn] :hello")
46+
end
4747

48-
test "formats error_logger warning report" do
49-
# Warnings by default are logged as errors by Erlang
50-
assert error_log(:warning_report, "hello") =~ msg("[error] \"hello\"")
51-
assert error_log(:warning_report, :hello) =~ msg("[error] :hello")
52-
assert error_log(:warning_report, :special, :hello) == ""
48+
test "formats error_logger warning report" do
49+
assert error_log(:warning_report, "hello") =~ msg("[warn] \"hello\"")
50+
assert error_log(:warning_report, :hello) =~ msg("[warn] :hello")
51+
assert error_log(:warning_report, :special, :hello) == ""
52+
end
5353
end
5454

5555
defp error_log(fun, format) do

0 commit comments

Comments
 (0)