Skip to content

Commit

Permalink
ex_unit defs have arity of 1
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Dec 27, 2023
1 parent a7fbd37 commit 148b701
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/elixir_sense/core/metadata_builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ defmodule ElixirSense.Core.MetadataBuilder do
state
|> add_call_to_line({nil, :test, 0}, {line, column})

pre_func(ast_without_params, state, meta, def_name, [])
pre_func(ast_without_params, state, meta, def_name, [{:_, [line: line, column: column], nil}])
end

# ex_unit test without context
Expand All @@ -681,7 +681,7 @@ defmodule ElixirSense.Core.MetadataBuilder do
state
|> add_call_to_line({nil, :test, 2}, {line, column})

pre_func(ast_without_params, state, meta, def_name, [])
pre_func(ast_without_params, state, meta, def_name, [{:_, [line: line, column: column], nil}])
end

# ex_unit test with context
Expand Down
4 changes: 2 additions & 2 deletions test/elixir_sense/core/metadata_builder_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -637,12 +637,12 @@ defmodule ElixirSense.Core.MetadataBuilderTest do

assert Map.has_key?(
state.mods_funs_to_positions,
{MyModuleTests, :"test this too does what I want", 0}
{MyModuleTests, :"test this too does what I want", 1}
)

assert Map.has_key?(
state.mods_funs_to_positions,
{MyModuleTests, :"test is not implemented", 0}
{MyModuleTests, :"test is not implemented", 1}
)
end

Expand Down

0 comments on commit 148b701

Please sign in to comment.