Skip to content

Remove deprecation warning check for 1.18 #14382

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

Merged
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
20 changes: 9 additions & 11 deletions lib/elixir/test/elixir/regex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ defmodule RegexTest do

if System.otp_release() >= "28" do
test "module attribute" do
assert ExUnit.CaptureIO.capture_io(:stderr, fn ->
defmodule ModAttr do
@regex ~r/example/
def regex, do: @regex
defmodule ModAttr do
@regex ~r/example/
def regex, do: @regex

@bare_regex :erlang.term_to_binary(@regex)
def bare_regex, do: :erlang.binary_to_term(@bare_regex)
@bare_regex :erlang.term_to_binary(@regex)
def bare_regex, do: :erlang.binary_to_term(@bare_regex)

# We don't rewrite outside of functions
assert @regex.re_pattern == :erlang.binary_to_term(@bare_regex).re_pattern
end
# We don't rewrite outside of functions
assert @regex.re_pattern == :erlang.binary_to_term(@bare_regex).re_pattern
end

assert ModAttr.regex().re_pattern != ModAttr.bare_regex().re_pattern
end) =~ "storing and reading regexes from module attributes is deprecated"
assert ModAttr.regex().re_pattern != ModAttr.bare_regex().re_pattern
end
end

Expand Down
Loading