Skip to content

Commit

Permalink
Update tests for two-fer
Browse files Browse the repository at this point in the history
  • Loading branch information
skeltoac committed Jul 21, 2024
1 parent 360c3f7 commit 1221ea6
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions test/elixir_analyzer/test_suite/two_fer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ defmodule ElixirAnalyzer.TestSuite.TwoFerTest do
defmodule TwoFer do
def two_fer(_)
end,
defmodule TwoFer do
def two_fer(name \\ "wrong default value")
end,
defmodule TwoFer do
def two_fer(name) do
"One for #{name}, one for me."
Expand All @@ -114,6 +111,21 @@ defmodule ElixirAnalyzer.TestSuite.TwoFerTest do
end
end

test_exercise_analysis "accepts any value as the default parameter",
comments_exclude: [Constants.two_fer_use_default_parameter()] do
[
defmodule TwoFer do
def two_fer(name \\ "you")
end,
defmodule TwoFer do
def two_fer(name \\ "wrong default value")
end,
defmodule TwoFer do
def two_fer(name \\ nil)
end
]
end

describe "function header" do
test_exercise_analysis "refer when using a function header",
comments_include: [Constants.two_fer_use_of_function_header()] do
Expand Down

0 comments on commit 1221ea6

Please sign in to comment.