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

Allow argument name is two-fer spec #414

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion lib/elixir_analyzer/test_suite/two_fer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ defmodule ElixirAnalyzer.TestSuite.TwoFer do
end

feature "has wrong spec" do
find :all
find :any
type :actionable
suppress_if "has spec", :fail
comment Constants.two_fer_wrong_specification()

form do
@spec two_fer(String.t()) :: String.t()
end

form do
@spec two_fer(_ignore :: String.t()) :: String.t()
end
end

feature "has default parameter" do
Expand Down
14 changes: 10 additions & 4 deletions test/elixir_analyzer/test_suite/two_fer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ defmodule ElixirAnalyzer.TestSuite.TwoFerTest do
Constants.solution_use_specification(),
Constants.two_fer_wrong_specification()
] do
defmodule TwoFer do
@spec two_fer(String.t()) :: String.t()
def two_fer(name)
end
[
defmodule TwoFer do
@spec two_fer(String.t()) :: String.t()
def two_fer(name)
end,
defmodule TwoFer do
@spec two_fer(name :: String.t()) :: String.t()
def two_fer(name)
end
]
end

test_exercise_analysis "refer when wrong spec",
Expand Down