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

Conversation

grzuy
Copy link
Contributor

@grzuy grzuy commented Jan 18, 2025

No description provided.

@grzuy grzuy changed the title test: avoids arithmetic warning in test test: avoids test warnings about obvious but intended errors Jan 20, 2025
@grzuy grzuy marked this pull request as ready for review January 20, 2025 19:04
@mtrudel
Copy link
Owner

mtrudel commented Jan 20, 2025

LGTM!

@mtrudel mtrudel merged commit 12c4e6b into mtrudel:main Jan 20, 2025
27 checks passed
@grzuy grzuy deleted the test-warnings-fix branch January 20, 2025 19:59
@@ -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

Copy link
Contributor Author

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()])

Hehe, cool.

I also updated the other crash site to use this same call, previously it was using 1 = self(). I assume that change is fine?

Yeah, that's fine.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants