File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 11defmodule 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
You can’t perform that action at this time.
0 commit comments