Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: avoids test warnings about obvious but intended errors #459

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/bandit/http1/plug_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ defmodule HTTP1PlugTest do
end

def unknown_crasher(_conn) do
1 / 0
1 + self()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up, realized that Elixir 1.18 with it's smarter compiler and "type checker" will warn about this also...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed this by calling apply(:erlang, :+, [1, self()])

I also updated the other crash site to use this same call, previously it was using 1 = self(). I assume that change is fine? They're both pushed to main in anticipation of a release later today

end

@tag :capture_log
Expand Down Expand Up @@ -112,7 +112,7 @@ defmodule HTTP1PlugTest do
get "/" do
# Quiet the compiler
_ = conn
1 = 0
1 = self()
end
end

Expand Down
Loading