Skip to content

Commit

Permalink
Allow argument name is two-fer @SPEC
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska committed Dec 24, 2023
1 parent bf1d881 commit 1d7c124
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
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

0 comments on commit 1d7c124

Please sign in to comment.