Skip to content

Commit

Permalink
Do not crash when moduledoc and other functions are listed in only, c…
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Sep 7, 2022
1 parent 780124f commit eff647e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ex_unit/lib/ex_unit/doc_test.ex
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ defmodule ExUnit.DocTest do
{tests, fun_arities} -> {[test | tests], [test.fun_arity | fun_arities]}
end

case only -- fun_arities do
case only -- [:moduledoc | fun_arities] do
[] ->
filtered_tests

Expand Down
5 changes: 4 additions & 1 deletion lib/ex_unit/test/ex_unit/doc_test_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,10 @@ defmodule ExUnit.DocTestTest do
# doctest ExUnit.DocTest

doctest ExUnit.DocTestTest.GoodModule, import: true
doctest ExUnit.DocTestTest.SomewhatGoodModuleWithOnly, only: [one: 0], import: true

doctest ExUnit.DocTestTest.SomewhatGoodModuleWithOnly,
only: [:moduledoc, one: 0],
import: true

doctest ExUnit.DocTestTest.SomewhatGoodModuleWithExcept,
except: [:moduledoc, two: 0],
Expand Down

0 comments on commit eff647e

Please sign in to comment.