Skip to content

Commit 1a6667d

Browse files
committed
Improve doctests docs
Closes #10314.
1 parent 1fca074 commit 1a6667d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/ex_unit/lib/ex_unit/doc_test.ex

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
defmodule ExUnit.DocTest do
22
@moduledoc """
3-
ExUnit.DocTest implements functionality similar to [Python's
4-
doctest](https://docs.python.org/2/library/doctest.html).
3+
Extract test cases from the documentation.
54
6-
It allows us to generate tests from the code
7-
examples in a module/function/macro's documentation.
8-
To do this, invoke the `doctest/1` macro from within
9-
your test case and ensure your code examples are written
10-
according to the syntax and guidelines below.
5+
Doctests allow us to generate tests from code examples found
6+
in `@moduledoc` and `@doc` attributes. To do this, invoke the
7+
`doctest/1` macro from within your test case and ensure your
8+
code examples are written according to the syntax and guidelines
9+
below.
1110
1211
## Syntax
1312
1413
Every new test starts on a new line, with an `iex>` prefix.
15-
Multiline expressions can be used by prefixing subsequent lines with either
16-
`...>` (recommended) or `iex>`.
14+
Multiline expressions can be used by prefixing subsequent lines
15+
with either `...>` (recommended) or `iex>`.
1716
1817
The expected result should start at the next line after the `iex>`
19-
or `...>` line(s) and is terminated either by a newline, new
20-
`iex>` prefix or the end of the string literal.
18+
or `...>` line(s) and it is terminated either by a newline.
2119
2220
## Examples
2321

0 commit comments

Comments
 (0)