Skip to content

Commit 6145599

Browse files
committed
Add t/0 types to remaining ExUnit exceptions (#13139)
1 parent abd4f54 commit 6145599

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

lib/ex_unit/lib/ex_unit.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ defmodule ExUnit do
148148
end
149149

150150
defmodule TimeoutError do
151+
@moduledoc """
152+
Exception raised when a test times out.
153+
"""
154+
155+
@typedoc since: "1.16.0"
156+
@type t :: %__MODULE__{
157+
timeout: non_neg_integer,
158+
type: String.t()
159+
}
160+
151161
defexception [:timeout, :type]
152162

153163
@impl true

lib/ex_unit/lib/ex_unit/case.ex

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
defmodule ExUnit.DuplicateTestError do
2+
@moduledoc """
3+
Exception raised to indicate two or more tests with the same name.
4+
"""
5+
6+
@typedoc since: "1.16.0"
7+
@type t :: %__MODULE__{message: String.t()}
8+
29
defexception [:message]
310
end
411

512
defmodule ExUnit.DuplicateDescribeError do
13+
@moduledoc """
14+
Exception raised to indicate two or more `describe` blocks with
15+
the same name.
16+
"""
17+
18+
@typedoc since: "1.16.0"
19+
@type t :: %__MODULE__{message: String.t()}
20+
621
defexception [:message]
722
end
823

lib/ex_unit/lib/ex_unit/doc_test.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ defmodule ExUnit.DocTest do
152152
@opaque_type_regex ~r/#[\w\.]+</
153153

154154
defmodule Error do
155+
@moduledoc """
156+
Exception raised when there's an error with the syntax or semantics of a doctest.
157+
"""
158+
159+
@typedoc since: "1.16.0"
160+
@type t :: %__MODULE__{message: String.t()}
155161
defexception [:message]
156162

157163
@impl true

0 commit comments

Comments
 (0)